This guide assumes you are migrating from the legacy V1 self-hosted setup. You are on the legacy configuration if you began self-hosting prior to February 2023.
Migrating from the legacy setup to the new V2 setup involves creating a database dump and importing it into your new environment.
Note that the steps below will only work if you are setting up the new V2 infrastructure from scratch. If you have previously created a V2 setup, the import files will be ignored, as the database has already been created and migrated.
Run the following command in your legacy environment:
This will create four database dump files:
Follow the guide here to setup a new folder where your V2 setup files will be placed. In this guide, we'll refer to this folder as
In order for the V2 setup to encrypt your setting with the same values as your legacy setup, you need to copy the following environment variables from your legacy setup to your V2 setup
sn-v2 directory, create the directory
data/import. Place the database dump files created above inside
mkdir -p data/import mv your-path-to-mysql-dumps/001-db-dump.sql data/import mv your-path-to-mysql-dumps/002-adjust.sql data/import mv your-path-to-mysql-dumps/003-revisions-dump.sql data/import mv your-path-to-mysql-dumps/004-revisions-ownership.sql data/import
Your data will be automatically imported once the V2 process starts. You can start it by running the following command inside your
docker compose up -d
To import your file uploads, copy the contents of
data/uploads from your legacy setup into the
sn-v2/uploads folder (create the
uploads directory if it doesn't exist).