FeministWiki:Server setup: Difference between revisions

Line 145: Line 145:
=== Copy over LDAP databases ===
=== Copy over LDAP databases ===


Stop the LDAP server and delete the existing configuration on the new server:
Stop the LDAP server and delete the existing configuration '''on the new server (careful there)''':


  systemctl stop slapd
  systemctl stop slapd
Line 157: Line 157:
=== Copy over SQL databases ===
=== Copy over SQL databases ===


Stop the database server:
Stop the database server '''on the new server (careful)''':


  systemctl stop mariadb
  systemctl stop mariadb


The following command can be used to create a dump of all databases and import it on the new server.  You can use the <code>show databases;</code> command in the SQL console to make sure that the list of databases is complete.  (Unfortunately they have to be listed manually, because using the <code>--all-databases</code> option includes system databases that we don't want to copy.)
The following command can be used to create a dump of all databases and import it on the new server.  You can use the <code>show databases;</code> command in the SQL console to make sure that the list of databases is complete.  (Unfortunately they have to be listed manually, because using the <code>--all-databases</code> option includes system databases that we don't want to copy.)
You have to run it from the old server:


  mysqldump -u root -p"$(cat /root/pwd/mysql)" \
  mysqldump -u root -p"$(cat /root/pwd/mysql)" \
Line 180: Line 182:
=== Copy over /var/www ===
=== Copy over /var/www ===


This is very simple but takes a lot of time to finish:
This is very simple but takes a lot of time to finish; run it from the old server:


  cd /var/www
  cd /var/www
Line 187: Line 189:
=== Reboot ===
=== Reboot ===


We could restart a lot of services manually to ensure they've read their new config, but it's easiest to just reboot.
We could restart a lot of services manually to ensure they've read their new config, but it's easiest to just reboot. (The new server, obviously.)


  reboot
  reboot