From 5866e7e0ff47c3aae060f04d7a57e0059368a87c Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 28 Nov 2020 18:08:20 +0700 Subject: [PATCH] modified: doc/Home.md modified: doc/Migrate.md --- doc/Home.md | 2 +- doc/Migrate.md | 33 +++++++++++++++------------------ 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/doc/Home.md b/doc/Home.md index 4d03ed2e5a..bd6fad7471 100644 --- a/doc/Home.md +++ b/doc/Home.md @@ -35,7 +35,7 @@ Friendica Documentation and Resources * [Using SSL with Friendica](help/SSL) * [Config values that can only be set in config/local.config.php](help/Config) * [Improve Performance](help/Improve-Performance) -* [Migrate to new server](help/Migrate) +* [Migrate](help/Migrate) * [Administration Tools](help/tools) **Developer Manual** diff --git a/doc/Migrate.md b/doc/Migrate.md index 0e769d07fa..7e2c494bf0 100644 --- a/doc/Migrate.md +++ b/doc/Migrate.md @@ -1,4 +1,4 @@ -Migrating to a new server +Migrating to a new server installation =============== * [Home](help) @@ -8,18 +8,17 @@ Migrating to a new server ### New server Set up your new server as described [here](Install); follow the installation procedure until you have created a database. -### Head up to users +### Heads up to users +Inform your users of an upcoming interruption to your service. To ensure data consistency, your server needs to be offline during some steps of the migration processes. -Inform your users of an upcoming interruption to your service. To ensure no loss of data, your server needs to be offline during some part of the migration processes. - -You may find these addons useful for in communicating with your users prior to the migration process: +You may also find these addons useful for communicating with your users prior to the migration process: * blackout * notifyall ### Storage -Check your storage backend with ``bin/console storage list`` in the root folder. The output should be like this: +Check your storage backend with ``bin/console storage list`` in the root folder. The output should look like this: ```` Sel | Name ----------------------- @@ -35,10 +34,9 @@ If you are *not* using ``Database`` run the following commands: This process may take a long time depending on the size of your storage and your server's capacity. Prior to initiating this process, you may want to check the number of files in the storage with the following command: ``tree -if -I index.html /path/to/storage/``. ### Cleaning up +Before transferring your database, you may want to clean it up; ensure the expiration of database items is set to a reasonable value and activated via the administrator panel. *Admin* > *Site* > *Performance* > Enable "Clean up database" -Before transferring your database, you may want to clean it up by ensuring the expiration of items is set to reasonable values in the administrator panel. *Admin* > *Site* > *Performance* > Enable "Clean up database" - -After adjusting these settings, the database cleaning up processes will be initiated according to your configured daily cron time frame. +After adjusting these settings, the database cleaning up processes will be initiated according to your configured daily cron job. To review the size of your database, log into MySQL with ``mysql -p`` run the following query: ``SELECT table_schema AS "Database", SUM(data_length + index_length) / 1024 / 1024 / 1024 AS "Size (GB)" FROM information_schema.TABLES GROUP BY table_schema;`` @@ -56,24 +54,23 @@ You should see an output like this: Finally, you may also want to optimise your database with the following command: ``mysqloptimize -p friendica-db`` -### Go offline -Take your web server offline. This will ensure consistency of your users' data. +### Going offline +Stop background tasks and put your server in maintenance mode. + +1. If you had set up a worker cron job like this ``*/10 * * * * cd /home/myname/mywebsite; /usr/bin/php bin/worker.php`` run ``crontab -e`` and comment out this line. Alternatively if you deploy a worker daemon, disable this instead. +2. Put your server into maintenance mode with a command like this: ``bin/console maintenance 1 "We are currently upgrading our system and will be back soon."`` ## Dumping DB - Dump you database: ``mysqldump -p friendica_db > friendica_db-$(date +%Y%m%d).sql`` and possibly compress it. -## Transferring to new installation - -Transfer your database and a copy of your configuration file ``config/local.config.php-copy`` to your new server. - -## Restore your DB +## Transferring to new server +Transfer your database and a copy of your configuration file ``config/local.config.php-copy`` to your new server installation. +## Restoring your DB Import your database on your new server: ``mysql -p friendica_db < your-friendica_db-file.sql`` ## Completing installation process - Ensure your DNS settings point to your new server. Complete the installation by adjusting the configuration settings and set up the required daily cron job.