Table of contents

Migration from v1

CodeX Docs v2 introduces some braking changes.

Firstly, v2 uses new unified configuration file instead of .codexdocssrc, .env and production.json files. You can find documentation for new config files here. You need to create docs-config.yaml file and migrate your configs according to documentation.

CodeX Docs v2 has support for MongoDB database and S3 storage for uploads as an option. By default local drivers will be used.

In order to migrate your uploads to S3 storage you need to set s3 uploads driver in config file. Then you need to copy all your data to S3 bucket and change all links in local database. You can fix links using your text editor or linux sed command (don't forget to make backup and change static.example.com in the following code):

sed 's/\/uploads\//https:\/\/static.example.com\//g' pages.db > pages.db

If you want to migrate your data from local database to MongoDB you need to do the following steps.

  1. Clone the codex.docs repo: git clone https://github.com/codex-team/codex.docs.git
  2. Put your local database in db folder
  3. Run the following command (don't forget to change --mongodb-uri param): node bin/db-converter --db-path=./db --mongodb-uri=mongodb://localhost:27017/docs

This command will convert and save your local database to MongoDB.