https://github.com/vapor-community/migrator
A package for updating from Vapor 1 to Vapor 2
https://github.com/vapor-community/migrator
Last synced: 5 months ago
JSON representation
A package for updating from Vapor 1 to Vapor 2
- Host: GitHub
- URL: https://github.com/vapor-community/migrator
- Owner: vapor-community
- Created: 2017-04-24T13:31:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-19T18:55:22.000Z (about 8 years ago)
- Last Synced: 2025-04-29T08:54:24.276Z (5 months ago)
- Language: Swift
- Size: 26.4 KB
- Stars: 6
- Watchers: 12
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vapor 1 -> 2 Migrator
This package can help you migrate your Vapor 1.x project to Vapor 2.0. It includes method stubs with deprecation warnings for Vapor 1 API that has changed or been removed.
### 1. Add Migrator to your `Package.swift`
Add `.Package(url: "https://github.com/vapor/migrator.git", majorVersion: 1)` to your `Package.swift` dependencies. Your file should look something like this ...
```swift
import PackageDescriptionlet package = Package(
name: "Project",
dependencies: [
...
.Package(url: "https://github.com/vapor/migrator.git", majorVersion: 1)
],
exclude: [ ... ]
)
```### 2. Update Dependencies
Update your project with `vapor update`
> Make sure to follow the prompts to regenerate your Xcode project, if you don't regenerate, it will _not_ work.
### 3. Import Migrator
Migrator should only be included temporarily, so pick _any_ file in your project, and add this import to the top.
```swift
@_exported import Migrator
```### 4. Build Your Project
Build your project with `cmd + b` or `cmd + r` if you're using an executable. This may fail, but will help Xcode with autocomplete.
### 5. Update Your Project
You should see a lot of deprecations, go through and use them to help you when you're updating your project.
### 6. Remove Migrator
Once you've used migrator to help you update your project, you should **remove migrator** from your `Package.swift` file, remove the `@_exported import Migrator` and run `vapor update` again. **DO NOT USE MIGRATOR IN PRODUCTION PROJECTS**
### 7. Enjoy Vapor 2
Enjoy Vapor 2, it's leaner, faster, and streamlined in just about every way, check out more of the full release notes.
[Vapor 2.0.0 release notes](https://github.com/vapor/vapor/releases/tag/2.0.0) for more information.