
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@vendure/migrate-v2
Advanced tools
This is a tool used to migrate your data from the Vendure v1.x DB schema to v2.0.0.
This is a tool used to migrate your data from the Vendure v1.x DB schema to v2.0.0.
Important It is critical that you back up your data prior to attempting this migration.
Note for MySQL/MariaDB users: transactions for migrations are not supported by these databases. This means that if the migration fails for some reason, the statements that have executed will not get rolled back, and your DB schema can be left in an inconsistent state from which is it can be hard to recover. Therefore, it is doubly critical that you have a good backup that you can easily restore prior to attempting this migration.
Install this package: npm install @vendure/migrate-v2
Update all your Vendure packages to the latest v2 versions.
"Cannot find module '@ardatan/aggregate-error'"
, delete node_modules and the lockfile and reinstall.Add the MigrationV2Plugin
to your plugins array:
import { MigrationV2Plugin } from '@vendure/migrate-v2';
//...
const config: VendureConfig = {
//..
plugins: [
MigrationV2Plugin,
]
}
The sole function of this plugin is to temporarily remove some "NOT NULL" constraints from certain columns, which allows us to run the next part of the migration.
Generate a new migration file, npm run migration:generate v2
(where v2
is the name of the migration, which you can choose).
Edit the newly-created migration file by following the comments in these examples:
In your migrations files, you'll import the vendureV2Migrations
from @vendure/migrate-v2
.
Run the migration with npm run migration:run
.
Upon successful migration, remove the MigrationV2Plugin
from your plugins array, and generate another migration. This one will add back the missing "NOT NULL" constraints now that all your data has been successfully migrated.
If you run into issues when attempting to migrate per the instructions above, please create an issue describing what you ran into.
The same goes for if you discover that some data has not migrated correctly, of if you have any suggestions on how to improve the migration experience.
The following instructions relate to building and running this repo for development purposes.
You'll need a local postgres instance running, with a database named v2-migration-testbed
. Adjust the
credentials in the .env
file as needed.
yarn populate
.yarn test
to run the tests against v1.x. Cannot find module '@ardatan/aggregate-error'
errors, try rm -rf node_modules && rm yarn.lock && yarn
yarn migrate
to run the migrations.yarn test
to run the tests against v2.x.By default, the tests will run against a Postgres database. To run against MySQL, you'll need to set up a local MySQL or MariaDB
instance, and then set the DB
environment variable to mysql
.
FAQs
This is a tool used to migrate your data from the Vendure v1.x DB schema to v2.0.0.
We found that @vendure/migrate-v2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.