From d28001e7f6702b176c87e3d6fd0f289e00d2f89e Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 25 Nov 2020 21:30:04 +0700 Subject: [PATCH 01/12] new file: doc/Migrate.md --- doc/Migrate.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 doc/Migrate.md diff --git a/doc/Migrate.md b/doc/Migrate.md new file mode 100644 index 000000000..77918bebb --- /dev/null +++ b/doc/Migrate.md @@ -0,0 +1,28 @@ +Migrating to a different Server +=============== + +* [Home](help) + +## Preparation + +### Storage +Check your storage backend with ``bin/console storage list`` in the root folder. + +If you are not currently using ``Database`` run the following commands: +1. ``bin/console storage set Database`` to active the database backend. +2. ``bin/console storage move`` to initiate moving the stored image files. + +This process may take a long time depending on the size of your storage. + +### Cleaning up + +[Removing expired items] + +### Configuration files + + +## Dumping DB + + +## Transferring to new installation + From e6a340b965864614a5979fb434220856ebb23aa3 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 25 Nov 2020 22:06:12 +0700 Subject: [PATCH 02/12] modified: doc/Migrate.md --- doc/Migrate.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/Migrate.md b/doc/Migrate.md index 77918bebb..8fc4193ba 100644 --- a/doc/Migrate.md +++ b/doc/Migrate.md @@ -5,6 +5,16 @@ Migrating to a different Server ## Preparation +### Head up to users + +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: + +* blackout +* notifyall + + ### Storage Check your storage backend with ``bin/console storage list`` in the root folder. @@ -21,6 +31,9 @@ This process may take a long time depending on the size of your storage. ### Configuration files +### Go offline +Take your web server offline. + ## Dumping DB From 97a88e1944a9eeac1c23ae27ee22a1946118b5a3 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 25 Nov 2020 23:59:06 +0700 Subject: [PATCH 03/12] modified: doc/Migrate.md --- doc/Migrate.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/Migrate.md b/doc/Migrate.md index 8fc4193ba..4093928d0 100644 --- a/doc/Migrate.md +++ b/doc/Migrate.md @@ -1,4 +1,4 @@ -Migrating to a different Server +Migrating to a new server =============== * [Home](help) @@ -28,6 +28,22 @@ This process may take a long time depending on the size of your storage. [Removing expired items] + +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;`` + +You should see an out like this: + +```` ++--------------------+----------------+ +| Database | Size (GB) | ++--------------------+----------------+ +| friendica | 8.054092407227 | +| [..........] | [...........] | ++--------------------+----------------+ +```` + ### Configuration files From c154bd057020be7882d38c73cf40ae9eb3a5b106 Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 28 Nov 2020 13:32:38 +0700 Subject: [PATCH 04/12] modified: doc/Migrate.md --- doc/Migrate.md | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/doc/Migrate.md b/doc/Migrate.md index 4093928d0..9ac70aec3 100644 --- a/doc/Migrate.md +++ b/doc/Migrate.md @@ -5,6 +5,9 @@ Migrating to a new server ## Preparation +### New server +Set up your new server as described [here] (install) by following installation procedure until you have created a database. + ### Head up to users 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. @@ -22,36 +25,50 @@ If you are not currently using ``Database`` run the following commands: 1. ``bin/console storage set Database`` to active the database backend. 2. ``bin/console storage move`` to initiate moving the stored image files. -This process may take a long time depending on the size of your storage. +This process may take a long time depending on the size of your storage and your server 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 -[Removing expired items] +Before transferring your database, you may want to clean it up by ensuring the expiration of items is set to reasonable value 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. 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;`` -You should see an out like this: - +You should see an output like this: ```` +--------------------+----------------+ | Database | Size (GB) | +--------------------+----------------+ -| friendica | 8.054092407227 | +| friendica_db | 8.054092407227 | | [..........] | [...........] | +--------------------+----------------+ ```` -### Configuration files - +Finally, you may also want optimise your database with the following command: +``mysqloptimize -p friendica-db`` ### Go offline -Take your web server offline. +Take your web server offline. This will ensure consistency of your users' data. ## 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 copy of your configuration file ``config/local.config.php-copy`` to your new server. + +## Import your DB + +Import your database: ``mysql -p friendica_db < your-friendica_db-file.sql`` + +## Completing installation process + +Complete the installation by adjusting the configuration settings and set up the required daily cron job. + + + From 8f75dc2380955a4477f76105cf66071d74bc506a Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 28 Nov 2020 13:35:29 +0700 Subject: [PATCH 05/12] modified: doc/Migrate.md --- doc/Migrate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Migrate.md b/doc/Migrate.md index 9ac70aec3..32d331ede 100644 --- a/doc/Migrate.md +++ b/doc/Migrate.md @@ -6,7 +6,7 @@ Migrating to a new server ## Preparation ### New server -Set up your new server as described [here] (install) by following installation procedure until you have created a database. +Set up your new server as described [here](install) by following installation procedure until you have created a database. ### Head up to users From 57bc1143f74546deebf19cfebee03d33e0be7871 Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 28 Nov 2020 13:36:40 +0700 Subject: [PATCH 06/12] modified: doc/Migrate.md --- doc/Migrate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Migrate.md b/doc/Migrate.md index 32d331ede..800bf1df8 100644 --- a/doc/Migrate.md +++ b/doc/Migrate.md @@ -6,7 +6,7 @@ Migrating to a new server ## Preparation ### New server -Set up your new server as described [here](install) by following installation procedure until you have created a database. +Set up your new server as described [here](Install) by following installation procedure until you have created a database. ### Head up to users From 6e71b75f47134a766b0f5c929bc51d37c697af5a Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 28 Nov 2020 13:43:58 +0700 Subject: [PATCH 07/12] modified: doc/Home.md modified: doc/Migrate.md --- doc/Home.md | 1 + doc/Migrate.md | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/Home.md b/doc/Home.md index 9ed552bd3..4d03ed2e5 100644 --- a/doc/Home.md +++ b/doc/Home.md @@ -35,6 +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) * [Administration Tools](help/tools) **Developer Manual** diff --git a/doc/Migrate.md b/doc/Migrate.md index 800bf1df8..892e4d375 100644 --- a/doc/Migrate.md +++ b/doc/Migrate.md @@ -55,16 +55,15 @@ Take your web server offline. This will ensure consistency of your users' data. ## 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 copy of your configuration file ``config/local.config.php-copy`` to your new server. -## Import your DB +## Restore your DB -Import your database: ``mysql -p friendica_db < your-friendica_db-file.sql`` +Import your database on your new server: ``mysql -p friendica_db < your-friendica_db-file.sql`` ## Completing installation process From 6752cf5e8fe6d89cea9dd1c0cc0d991296fd4049 Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 28 Nov 2020 14:01:42 +0700 Subject: [PATCH 08/12] modified: doc/Migrate.md --- doc/Migrate.md | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/doc/Migrate.md b/doc/Migrate.md index 892e4d375..371883562 100644 --- a/doc/Migrate.md +++ b/doc/Migrate.md @@ -6,7 +6,7 @@ Migrating to a new server ## Preparation ### New server -Set up your new server as described [here](Install) by following installation procedure until you have created a database. +Set up your new server as described [here](Install); follow the installation procedure until you have created a database. ### Head up to users @@ -19,17 +19,24 @@ You may find these addons useful for in communicating with your users prior to t ### Storage -Check your storage backend with ``bin/console storage list`` in the root folder. +Check your storage backend with ``bin/console storage list`` in the root folder. The output should be like this: +```` +Sel | Name +----------------------- + | Filesystem + * | Database +```` -If you are not currently using ``Database`` run the following commands: -1. ``bin/console storage set Database`` to active the database backend. -2. ``bin/console storage move`` to initiate moving the stored image files. +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 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/``. +1. ``bin/console storage set Database`` to activate the database backend. +2. ``bin/console storage move`` to initiate moving the stored image files. + +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 by ensuring the expiration of items is set to reasonable value in 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. @@ -46,7 +53,7 @@ You should see an output like this: +--------------------+----------------+ ```` -Finally, you may also want optimise your database with the following command: +Finally, you may also want to optimise your database with the following command: ``mysqloptimize -p friendica-db`` ### Go offline @@ -59,7 +66,7 @@ and possibly compress it. ## Transferring to new installation -Transfer your database and copy of your configuration file ``config/local.config.php-copy`` to your new server. +Transfer your database and a copy of your configuration file ``config/local.config.php-copy`` to your new server. ## Restore your DB From 6e579e82e612b0458685df11b2611be43a8f9f59 Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 28 Nov 2020 14:13:18 +0700 Subject: [PATCH 09/12] modified: doc/Migrate.md --- doc/Migrate.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/Migrate.md b/doc/Migrate.md index 371883562..0e769d07f 100644 --- a/doc/Migrate.md +++ b/doc/Migrate.md @@ -74,7 +74,11 @@ Import your database on your new server: ``mysql -p friendica_db < your-friendic ## 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. + + From 5866e7e0ff47c3aae060f04d7a57e0059368a87c Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 28 Nov 2020 18:08:20 +0700 Subject: [PATCH 10/12] 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 4d03ed2e5..bd6fad747 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 0e769d07f..7e2c494bf 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. From 893087aa76e804b84b0f9d564c2fd3a3db2ef54b Mon Sep 17 00:00:00 2001 From: Andy Date: Sun, 29 Nov 2020 11:04:31 +0700 Subject: [PATCH 11/12] modified: doc/Migrate.md --- doc/Migrate.md | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/doc/Migrate.md b/doc/Migrate.md index 7e2c494bf..50df539e2 100644 --- a/doc/Migrate.md +++ b/doc/Migrate.md @@ -9,37 +9,39 @@ Migrating to a new server installation Set up your new server as described [here](Install); follow the installation procedure until you have created a database. ### 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 data consistency, your server needs to be offline during some steps of the migration processes. 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 look like this: +Check your storage backend with ``bin/console storage list`` in the root folder. +The output should look like this: ```` -Sel | Name +Sel | Name ----------------------- - | Filesystem - * | Database + | Filesystem + * | Database ```` If you are *not* using ``Database`` run the following commands: - 1. ``bin/console storage set Database`` to activate the database backend. 2. ``bin/console storage move`` to initiate moving the stored image files. -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/``. +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; 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" 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;`` +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; +```` You should see an output like this: ```` @@ -51,21 +53,18 @@ You should see an output like this: +--------------------+----------------+ ```` -Finally, you may also want to optimise your database with the following command: -``mysqloptimize -p friendica-db`` +Finally, you may also want to optimise your database with the following command: ``mysqloptimize -p friendica-db`` ### 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."`` +1. If you had set up a worker cron job like this ``*/10 * * * * cd /var/www/friendica; /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: ``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. +Export your database: ``mysqldump -p friendica_db > friendica_db-$(date +%Y%m%d).sql`` and possibly compress it. ## Transferring to new server -Transfer your database and a copy of your configuration file ``config/local.config.php-copy`` to your new server installation. +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`` @@ -73,9 +72,4 @@ Import your database on your new server: ``mysql -p friendica_db < your-friendic ## 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. - - - - - +Complete the installation by adjusting the configuration settings and set up the required daily cron job. \ No newline at end of file From dd4f8d13516ecf3bbb9c9ca6b9ab875765f5253f Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 30 Nov 2020 12:00:07 +0700 Subject: [PATCH 12/12] modified: doc/Migrate.md --- doc/Migrate.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/doc/Migrate.md b/doc/Migrate.md index 50df539e2..e116d029f 100644 --- a/doc/Migrate.md +++ b/doc/Migrate.md @@ -69,7 +69,24 @@ Transfer your database and a copy of your configuration file ``config/local.conf ## 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. +## Completing migration + +### Configuration file +Copy your old server's configuration file to ``config/local.config.php``. +Ensure the newly created database credentials are identical to the setting in the configuration file; otherwise update them accordingly. + +### Cron job for worker +Set up the required daily cron job. +Run ``crontab -e`` and add the following line according to your system specification +``*/10 * * * * cd /var/www/friendica; /usr/bin/php bin/worker.php`` + +### DNS settings +Adjust your DNS records by pointing them to your new server. + +## Troubleshooting +If you are unable to login to your newly migrated Friendica installation, check your web server's error and access logs and mysql logs for obvious issues. + +If still unable to resolve the problem, it's likely an issue with your [installation](Install). +In this case, you may try to an entirely new Friendica installation on your new server, but use a different FQDN and DNS name. +Once you have this up and running, take it offline and purge the database and configuration file and try migrating to this installation. -Complete the installation by adjusting the configuration settings and set up the required daily cron job. \ No newline at end of file