Skip to content

Commit

Permalink
include migration steps to stop the redis-server service on your new …
Browse files Browse the repository at this point in the history
…machine before copying the redis dump file (#1587)

* include migration steps to stop the redis-server service on your new machine before copying the redis dump file

* use single command for redis-cli SAVE instead of opening then exiting the interactive client
  • Loading branch information
brookmiles authored Jan 23, 2025
1 parent 91c68f3 commit a6e92cd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions content/en/admin/migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This guide was written with Ubuntu Server in mind; your mileage may vary for oth
3. Dump and load the PostgreSQL database using the instructions below.
4. Copy the `system/` files using the instructions below. (Note: if you’re using S3, you can skip this step.)
5. Copy the `.env.production` file.
6. Save the Redis database, stop the Redis service, and copy the Redis database from `/var/lib/redis/` to the new server.
6. Save the Redis database, stop the Redis service on both your old and new machines, and copy the Redis database from `/var/lib/redis/` to the new server.
7. Run `RAILS_ENV=production bundle exec rails assets:precompile` to compile Mastodon
8. Start Mastodon and Redis on the new server.
9. Run `RAILS_ENV=production ./bin/tootctl feeds build` to rebuild the home timelines for each user.
Expand Down Expand Up @@ -98,12 +98,16 @@ You’ll want to re-run this if any of the files on the old server change.

You should also copy over the `.env.production` file, which contains secrets.

On your new machine, ensure that Redis is not running, otherwise it may overwrite the dump file you are trying to restore. As the `root` user, run:

```bash
systemctl stop redis-server.service
```

Now copy your Redis database over (adjust the location of your Redis database as needed). On your old machine, as the `root` user, run:

```bash
redis-cli
SAVE
EXIT
redis-cli SAVE
systemctl stop redis-server.service
rsync -avz /var/lib/redis/ [email protected]:/var/lib/redis
```
Expand Down

0 comments on commit a6e92cd

Please sign in to comment.