Migrating to a new server... this worked for me

Recently migrated from a very old Ubuntu server to the latest LTS. The following is how I successfully migrated 2 different instances and users of ttrss to the new server. Both new and old use MYSQL. This worked well for me. Your mileage may vary, no guarantees. Proceed at your own risk.

  1. OLD Server - dump the DB to a .sql file in my home directory. Sorry but this might be the weak link in this howto. I just googled how to do it and used the resulting MYSQL commend I got from google. I did it as the ttrss DB_USER (see config.php) but had a little trouble with the right privileges. When I finally got it to dump I had trouble logging in on the old server with the user. I ‘think’ had I dumped the DB as root it might have been fine.

  2. NEW Sever - mount the old drive and do an archive copy of the old ttrss directory to its new location. 'sudo cp -arv " (you know the rest). Don’t do any git pulls or other updates until you can log in on the new server with the old user.

  3. NEW SERVER - MYSQL stuff

// Enter into MySQL using “root” user identified by password
mysql -u root -p

//Create the database. Where DB_NAME comes from old config.php
mysql> CREATE DATABASE DB_NAME;

//Create the user. Where DB_USER DB_PASS comes from old config.php
mysql> CREATE USER ‘DB_USER’@‘localhost’ IDENTIFIED BY ‘DB_PASS’;

//Grant ALL privileges on the new database to the new User. Where DB_NAME DB_USER DB_PASS comes from old config.php
mysql> GRANT ALL PRIVILEGES ON DB_NAME.* TO ‘DB_USER’@‘localhost’ IDENTIFIED BY ‘DB_PASS’;

//Switch to the New Database. Where DB_NAME comes from old config.php
mysql> USE DB_NAME;

//Insert data from source.sql … use full path
mysql> SOURCE source.sql

mysql> exit

  1. move your old config.php to a backup for safe keeping

  2. READ ALL OF THIS STEP BEFORE DOING ANY
    5a. Goto http://yoursite/tt-rss/install/.
    5b. Open your backed up config.php because the answer to the question in the install script are easy to copy/paste from there.
    5c. Don’t initialize the db - At the end of the install script it will say something like “We a see your DB already has contents. Do you want to initialize?” SAY NO!!

That’s all. Go to ttrss page as normal and log in as the old user.

Best of luck. Standard disclaimers apply. I don’t guarantee good results.

Source - MYSQL commands - Question | DigitalOcean