Files
ess-helm/docs/migrating.md
T

3.2 KiB

Migrating

From Ansible Docker Deploy project

If you want to migrate from Ansible Docker Deploy project, follow the following steps :

  1. Follow the Preparing the environment section of the documentation.
  2. Install yq.
  3. Run this command: ./scripts/ansible-docker-deploy-to-values.sh /matrix ~/ess-config-values. This will create initial values file with all your configuration from ansible-docker-deploy.
  4. A difference with the ansible-docker-deploy project is that Matrix Authentication Service is deployed under a dedicated hostname. If you are using Matrix Authentication Service, replace CHANGEME with the new DNS Name for MAS in the generated hostnames.yaml.
  5. Install PostgreSQL on your server. Make sure that k3s can access it :
  6. In postgresql.conf, listen_addresses must be set to a routable IP of your server, different from localhost. Usually, you can use the same IP as the one discovered by Traefik in the reverse proxy configuration.
  7. In pg_hba.conf, make sure that you allow synapse and Matrix Authentication Service :
host    <synapse db>         <synapse_user>    10.42.0.1/24            md5
host    <mas db>             <mas_user>       10.42.0.1/24            md5
  1. Make sure that the firewall denies connections from outside of the server, and allows connection from your 10.42.0.1/24 network.
  2. Create a new database for Synapse and Matrix Authentication Service. Follow the Using a dedicated PostgreSQL database section of the advanced documentation.
  3. Stop Synapse systemd unit: sudo systemctl stop matrix-synapse.service
  4. Export matrix-ansible-docker PostgreSQL Synapse database into a local dump : docker exec matrix-postgres pg_dump -C -h localhost -U matrix synapse > ./synapse.sql
  5. Adjust the user from the dump file to match your new database user and password: sed -i 's/OWNER TO synapse/OWNER TO <your_synapse_user>/g' synapse.sql
  6. Import matrix-ansible-docker PostgreSQL Synapse database into your new Synapse database : sudo -u postgres psql <synapse_db> < synapse.sql
  7. Follow the Certificates section of the documentation
  8. Follow the Installation section of the documentation
  9. Import the media-store from your old Synapse to your new one :
    1. Import local_content : sudo kubectl cp -n ess /matrix/synapse/storage/media-store/local_content ess-synapse-main-0:/media/media_store
    2. Import local_thumbnails : sudo kubectl cp -n ess /matrix/synapse/storage/media-store/local_thumbnails ess-synapse-main-0:/media/media_store
    3. Import remote_content : sudo kubectl cp -n ess /matrix/synapse/storage/media-store/remote_content ess-synapse-main-0:/media/media_store
  10. Follow the verification steps of the documentation to assert that your server is running properly.

The migration should now be completed.