1,106
edits
Technician (talk | contribs) |
Technician (talk | contribs) No edit summary |
||
Line 26: | Line 26: | ||
Before restarting the SSH service, make sure you've actually added your public key (the contents of {{C|~/.ssh/id_rsa.pub}} on your computer) to {{C|/root/.ssh/authorized_keys}} on the server, or you'll lock yourself out. | Before restarting the SSH service, make sure you've actually added your public key (the contents of {{C|~/.ssh/id_rsa.pub}} on your computer) to {{C|/root/.ssh/authorized_keys}} on the server, or you'll lock yourself out. | ||
=== Copy SSH key from old server === | === Copy SSH key from old server === | ||
Line 50: | Line 48: | ||
apt-get install ufw | apt-get install ufw | ||
ufw allow proto tcp to 0.0.0.0/0 port ${SSH_PORT} | ufw allow proto tcp to 0.0.0.0/0 port ${SSH_PORT} # Replace with actual port number | ||
ufw enable | ufw enable | ||
Line 165: | Line 163: | ||
Copy over the certs from the old server: | Copy over the certs from the old server: | ||
tar -czPf- /etc/fw-certs | ssh feministwiki.dev | tar -czPf- /etc/fw-certs | ssh feministwiki.dev 'tar -xzPf-' | ||
The {{C|/etc/fw-certs}} directory and its contents should be owned by the group {{C|ssl-cert}}. Make sure this is the case on the new server after running the command above, since the group ID might be different on the new server. If the group doesn't exist at all, just create it. | The {{C|/etc/fw-certs}} directory and its contents should be owned by the group {{C|ssl-cert}}. Make sure this is the case on the new server after running the command above, since the group ID might be different on the new server. If the group doesn't exist at all, just create it. | ||
Line 210: | Line 208: | ||
Then copy over the configuration database, by running the following commands from the old server: | Then copy over the configuration database, by running the following commands from the old server: | ||
slapcat -n 0 | ssh feministwiki.dev | slapcat -n 0 | ssh feministwiki.dev 'sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d' | ||
==== Breaking changes in OpenLDAP ==== | ==== Breaking changes in OpenLDAP ==== | ||
Line 247: | Line 245: | ||
# Open the file in a text editor and delete the block starting with the line {{C|<nowiki>dn: cn={4}ppolicy,cn=schema,cn=config</nowiki>}}, up to the next empty line (before the next block starting with a {{C|dn: ...}} line), and save the file. | # Open the file in a text editor and delete the block starting with the line {{C|<nowiki>dn: cn={4}ppolicy,cn=schema,cn=config</nowiki>}}, up to the next empty line (before the next block starting with a {{C|dn: ...}} line), and save the file. | ||
# Feed the file to {{C|slapadd -n 1}} on the new server: | # Feed the file to {{C|slapadd -n 1}} on the new server: | ||
#: <pre>cat slapcat.n0.out | ssh feministwiki.dev | #: <pre>cat slapcat.n0.out | ssh feministwiki.dev 'sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d'</pre> | ||
== Copying over live data == | == Copying over live data == | ||
Line 261: | Line 259: | ||
Then copy over the database by running the following command from the old server: | Then copy over the database by running the following command from the old server: | ||
slapcat -n 1 | ssh feministwiki.dev | slapcat -n 1 | ssh feministwiki.dev 'sudo -u openldap slapadd -n 1' | ||
Although there may be breaking changes that make this command fail, just as with the copying of the configuration database explained earlier, the chance is much lower for the regular "data" database, so hopefully the command will run fine. | Although there may be breaking changes that make this command fail, just as with the copying of the configuration database explained earlier, the chance is much lower for the regular "data" database, so hopefully the command will run fine. | ||
Line 290: | Line 288: | ||
feministwiki_pt \ | feministwiki_pt \ | ||
fff \ | fff \ | ||
| gzip | ssh root@feministwiki.dev | | gzip | ssh root@feministwiki.dev 'gunzip | /root/bin/sql' | ||
You can use the {{C|show databases;}} 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 {{C|--all-databases}} option includes system databases that we don't want to copy. | You can use the {{C|show databases;}} 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 {{C|--all-databases}} option includes system databases that we don't want to copy. |