# Central Backup Restore

**URL:** <https://forum.getodk.org/t/central-backup-restore/33047>\
**Category:** Support\
**Created:** [April 1, 2021, 3:08pm UTC](https://forum.getodk.org/t/central-backup-restore/33047 "2021-04-01T15:08:25Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [May 8, 2021, 9:07pm UTC](https://forum.getodk.org/t/central-backup-restore/33047/10 "2021-05-08T21:07:35Z")

</div>

One way to fix the broken previews and web submissions is to download the XLSForm of each form, change the version number, and re-upload the form. This will generate entirely new previews and web submissions links and is a very quick fix if you don't have an ongoing campaign.

If you have distributed public access links and have an ongoing campaign that uses those links, then new previews and web submissions links might be too disruptive. In that case, you'll need to dump the Enketo databases and secrets from the old machine and restore it to the new machine so you can have your old previews and web submission links.

The instructions below assume that you are not changing the externally facing hostname (e.g., [mycentralserver.example.com](http://mycentralserver.example.com)). If you are, you'll need find and replace the hostnames in the Enketo databases. Doing that is possible, but is out of scope for this post.

**I strongly recommend you have a snapshot of both machines before taking any of the following steps!**

On the old machine, make sure Central is running as usual. Run the following commands to dump the databases and secrets.

```auto
docker exec enketo_redis_main redis-cli -p 6379 save;
docker cp enketo_redis_main:/data/enketo-main.rdb ~/enketo-main.rdb;
docker exec enketo_redis_cache redis-cli -p 6380 save;
docker cp enketo_redis_cache:/data/enketo-cache.rdb ~/enketo-cache.rdb;
docker cp service:/etc/secrets ~/;

```

Now transfer the `enketo-main.rdb`, `enketo-cache.rdb`, `secrets` files from the home folder of the old machine to the home folder of the new machine. Make sure Central is running as usual, then run the following.

```auto
docker stop enketo_redis_main;
docker cp ~/enketo-main.rdb enketo_redis_main:/data/enketo-main.rdb;
docker start enketo_redis_main;
docker stop enketo_redis_cache;
docker cp ~/enketo-cache.rdb enketo_redis_cache:/data/enketo-cache.rdb;
docker start enketo_redis_cache;
docker stop service;
docker cp ~/secrets service:/etc;
docker start service;

```

In your `secrets` folder, you'll have three files: `enketo-api-key`, `enketo-less-secret`, `enketo-secret`. You'll need to use nano to edit your Enketo config to those values.

```auto
docker exec -it enketo sh;
apt-get install nano -y;
nano config/config.json;

```

Update `config/config.json` with the `secrets` values.

```json
{
    "app name": "Enketo",
    "base path": "-",
    "encryption key": "contents of enketo-secret",
    "id length": 31,
    "less secure encryption key": "contents of enketo-less-secret",
    "linked form and data server": {
        "api key": "contents of enketo-api-key",

```

Now uninstall nano, and exit enketo container.

```auto
apt-get remove nano -y;
exit;

```

Now restart enketo.

```auto
docker restart enketo;

```

---

_[View the full topic](https://forum.getodk.org/t/central-backup-restore/33047)._
