How do I migrate Backlog server?

The procedure for migrating the Backlog server is as follows.

1. System requirements

  • The same version of database as the migration source is installed at the migration destination.
  • The same version of Backlog as the migration source is installed at the migration destination.

To learn how to install Backlog, please see the Installation Guide.

2. Overview

  • Database
  • Directories storing icon images
  • Directories storing Subversion data
  • Directories storing Git data
  • Directories storing search index data
  • Directories storing shared file (WebDAV) data

Each storage directory exists under /opt/backlog/data. In the following section, we will refer to /opt/backlog/data as data area directory.

3. Migration procedure

Please follow the steps below to perform the migration.

The space owner information (database record) of the destination server will be overwritten, so please use the space owner information of the source server after the migration.

Source server

  1. Stop Backlog
  2. Create a database dump fie
  3. Compress data area directory

Destination server

  1. Get the dump file and the compressed data area files from the source server
  2. Stop Backlog
  3. Delete the database created at the time of installation, and create a new database
  4. Empty the data area directory
  5. Restore the database dump file
  6. Uncompress the compressed data area files and copy them to the data area of the destination server
  7. Start Backlog

A more detailed procedure is shown below with commands as follows.

Database backlog
Database user backlog
Migration data storage location at the destination server /mnt

Source server

1. Stop Backlog.

service backlog-www stop
service backlog-app stop
service backlog-mobile stop
service backlog-git stop
service backlog-api stop

2. Create a database dump file.

For PostgreSQL

pg_dump -U backlog backlog > backlog-dump.sql

For MySQL

mysqldump -ubacklog -p --opt backlog > backlog-dump.sql

3. Compress the nine directories in the data area.

cd /opt/backlog/data
tar cvf backlog-data-image.tar image
tar cvf backlog-data-svn.tar svn
tar cvf backlog-data-git.tar git
cd lucene
tar cvf backlog-data-lucene-index.tar index
cd ../solr/issue
tar cvf backlog-data-solor-issue-data.tar data
cd ../wiki
tar cvf backlog-data-solr-wiki-data.tar data
cd ../pull_request
tar cvf backlog-data-solr-pull_request-data.tar data
cd ../shred_file
tar cvf backlog-data-solr-shred_file-data.tar data
cd ../../share
tar cvf backlog-data-share-dav.tar dav

Destination server

4. Get the dump file and the compressed files from the source server. Save them to below /mnt using scp etc. from the destination server.

5. Stop Backlog.

service backlog-www stop
service backlog-app stop
service backlog-mobile stop
service backlog-git stop
service backlog-api stop

6. Delete the database created at the time of installation, and create a new database.

For PostgreSQL

dropdb -U backlog backlog
createdb -U backlog -E UTF8 backlog

For MySQL

mysqladmin -u backlog -p drop backlog
mysqladmin -u backlog -p create backlog

7. Empty the data area directory.

rm -rf /opt/backlog/data/image
rm -rf /opt/backlog/data/svn
rm -rf /opt/backlog/data/git
rm -rf /opt/backlog/data/lucene/index
rm -rf /opt/backlog/data/solr/issue/data
rm -rf /opt/backlog/data/solr/wiki/data
rm -rf /opt/backlog/data/solr/pull_request/data
rm -rf /opt/backlog/data/solr/shared_file/data
rm -rf /opt/backlog/data/share/dav

8. Restore the database dump file created at the source server.

For PostgreSQL

psql -U backlog backlog < /mnt/backlog-dump.sql

For MySQL

mysql -ubacklog -p backlog < /mnt/backlog-dump.sql

9. Restore the data area.

mkdir /mnt/backlog-data
mkdir /mnt/backlog-data/image
tar xvf /mnt/backlog-data-image.tar -C /mnt/backlog-data/image
cp -r /mnt/backlog-data/image/image /opt/backlog/data

mkdir /mnt/backlog-data/svn
tar xvf /mnt/backlog-data-svn.tar -C /mnt/backlog-data/svn
cp -r /mnt/backlog-data/svn/svn /opt/backlog/data

mkdir /mnt/backlog-data/git
tar xvf /mnt/backlog-data-git.tar -C /mnt/backlog-data/git
cp -r /mnt/backlog-data/git/git /opt/backlog/data

mkdir /mnt/backlog-data/lucene-index
tar xvf /mnt/backlog-data-lucene-index.tar -C /mnt/backlog-data/lucene-index
cp -r /mnt/backlog-data/lucene-index/index /opt/backlog/data/lucene

mkdir /mnt/backlog-data/solr-issue-data
tar xvf /mnt/backlog-data-solr-issue-data.tar -C /mnt/backlog-data/solr-issue-data
cp -r /mnt/backlog-data/solr-issue-data/data /opt/backlog/data/solr/issue

mkdir /mnt/backlog-data/solr-wiki-data
tar xvf /mnt/backlog-data-solr-wiki-data.tar -C /mnt/backlog-data/solr-wiki-data
cp -r /mnt/backlog-data/solr-wiki-data/data /opt/backlog/data/solr/wiki

mkdir /mnt/backlog-data/solr-pull_request-data
tar xvf /mnt/backlog-data-solr-pull_request-data.tar -C /mnt/backlog-data/solr-pull_request-data
cp -r /mnt/backlog-data/solr-pull_request-data/data /opt/backlog/data/solr/pull_request

mkdir /mnt/backlog-data/solr-shared_file-data
tar xvf /mnt/backlog-data-solr-shared_file-data.tar -C /mnt/backlog-data/solr-shared_file-data
cp -r /mnt/backlog-data/solr-shared_file-data/data /opt/backlog/data/solr/shared_file

mkdir /mnt/backlog-data/share-dav
tar xvf /mnt/backlog-data-share-dav.tar -C /mnt/backlog-data/share-dav
cp -r /mnt/backlog-data/share-dav/dav /opt/backlog/data/share

Specify backlog for the owner and group of the data area directory.

chown -R backlog.backlog /opt/backlog/data

10. Start Backlog.

service backlog-app start
service backlog-git start
service backlog-mobile start
service backlog-www start
service backlog-api start

This completes the data migration. When accessing the Backlog screen via the Browser for the first time, please check and set the space URL from Space settings > Edit space.

Back to list