mirror of
https://github.com/mastodon/documentation
synced 2025-04-11 22:56:17 +02:00
include migration steps to stop the redis-server service on your new 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
This commit is contained in:
parent
91c68f33b3
commit
a6e92cd1b1
@ -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.
|
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.)
|
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.
|
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
|
7. Run `RAILS_ENV=production bundle exec rails assets:precompile` to compile Mastodon
|
||||||
8. Start Mastodon and Redis on the new server.
|
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.
|
9. Run `RAILS_ENV=production ./bin/tootctl feeds build` to rebuild the home timelines for each user.
|
||||||
@ -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.
|
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:
|
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
|
```bash
|
||||||
redis-cli
|
redis-cli SAVE
|
||||||
SAVE
|
|
||||||
EXIT
|
|
||||||
systemctl stop redis-server.service
|
systemctl stop redis-server.service
|
||||||
rsync -avz /var/lib/redis/ root@example.com:/var/lib/redis
|
rsync -avz /var/lib/redis/ root@example.com:/var/lib/redis
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user