From 116a961cb44d0682d1eeb09841a97578c297b47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 6 Jul 2022 09:21:23 +0200 Subject: [PATCH] Create migration --- conf/migration | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 conf/migration diff --git a/conf/migration b/conf/migration new file mode 100644 index 0000000..15e836d --- /dev/null +++ b/conf/migration @@ -0,0 +1,30 @@ +# OPML import/export (including filters and some settings). Must be done before data_migration plugin if you want to keep feed categories + +# on the original machine +sudo mkdir /var/www/tt-rss/export +sudo chown -R www-data:www-data /var/www/tt-rss/export/ +sudo -u www-data php /var/www/tt-rss/update.php --opml-export "MYUSERNAME /var/www/tt-rss/export/export-2020-08-07.opml" # export feeds OPML +# on a client +rsync -avP my.original.machine.org:/var/www/tt-rss/export/export-2020-08-07.opml ./ # download opml export +# login to the new tt-rss instance from a browser, go to Preferences > Feeds, import OPML file + +# migrate all articles from mysql to postgresql +# on the original machine +git clone https://git.tt-rss.org/fox/ttrss-data-migration +sudo chown -R root:www-data ttrss-data-migration/ +sudo mv ttrss-data-migration/ /var/www/tt-rss/plugins.local/data_migration +sudo nano /var/www/tt-rss/config.php # enable data_migration in the PLUGINS array +sudo -u www-data php /var/www/tt-rss/update.php --data_user MYUSERNAME --data_export /var/www/tt-rss/export/export-2020-08-07.zip # export articles to database-agnostic format + +# on the target machine +git clone https://git.tt-rss.org/fox/ttrss-data-migration +sudo chown -R root:www-data ttrss-data-migration/ +sudo mv ttrss-data-migration/ /var/www/rss.example.org/plugins.local/data_migration +sudo nano /var/www/rss.example.org/config.php # enable data_migration in the PLUGINS array +rsync -avP my.original.machine.org:/var/www/tt-rss/export/export-2020-08-07.zip ./ +sudo mkdir /var/www/rss.example.org/export +sudo mv export-2020-08-07.zip /var/www/rss.example.org/export +sudo chown -R root:www-data /var/www/rss.example.org/export +sudo chmod -R g+rX /var/www/rss.example.org/export/ +sudo -u www-data php /var/www/rss.example.org/update.php --data_user MYUSERNAME --data_import /var/www/rss.example.org/export/export-2020-08-07.zip # it can take a while +sudo rm -r /var/www/rss.example.org/export/ # cleanup \ No newline at end of file