Skip to content

Restoring an Archetype backup

Geoffroy Noël edited this page Mar 29, 2023 · 9 revisions

How do I restore an Archetype backup?

This document explains how to restore a backup of an Archetype instance. The file is usually named archetype.tar.gz and contains the database, the image files, the configuration and customisations of your Archetype instance. The software itself is hosted separately on Dockerhub and can be downloaded and run on your machine using Docker.

The following instructions have been tested on a Linux machine. They should work fine on a Mac. The terminal instruction / commands supplied in this document are designed for Mac & Linux but may need some adaptation for Windows. Please create a new issue on github if you need help and we'll try to respond when we can.

1. Save your backup on a separate disk

Before restoring your backup, it is strongly recommended to save a copy to a separate disk (USB key or external hard drive). This will save space on your computer and reduce the risk of accidental removal.

2. Place the backup file in an empty folder

Create a new folder and copy archetype.tar.gz there. Make sure there is no other file or directory in that folder before installing archetype.

The following steps assume that you have created a folder 'archetype' directly under your home directory.

You can do that from the command line with the following instruction:

mkdir ~/archetype

3. Install Docker Desktop

Please refer to the Docker Desktop documentation for instructions on how to download, install and start Docker.

4. Install Archetype

Start a terminal session in your archetype folder and run the following command:

docker stop archetype; docker run --name archetype -v ~/archetype:/home/digipal/digipal_project:cached -p 9080:80 kingsdigitallab/archetype:latest

It may take several minutes before the application is downloaded and launched. This is because the content is unpacked, the database restored and the search re-indexed. Please be patient as some of these steps can appear to move very slowly.

If all goes well you should eventually see the following output at the end:

==================
WEBSITE IS RUNNING
==================

5. Visit your Archetype web site

Point your browser to the following address http://localhost:9080/ and the Archetype home page should appear.

6. Create a new superuser

In many cases you'll want to log into Archetype (see the link in the footer of your site) to edit or view all your content. If you already have a user and remember the password you can skip this step. Otherwise you'll need to create a new superuser (i.e. a user who has full permission to the content and admin interface).

Open a new terminal session and type the following command:

docker exec -ti archetype python manage.py createsuperuser

Then fill in the form (Email field can be left blank).

Username (leave blank to use 'root'): jsmith    
Email address: 
Password: 
Password (again): 
Superuser created successfully.

You can now log in using that user and password.

7. Stop your web site

To stop the Archetype, you can use Docker Desktop interface or use the following command from a new terminal window:

docker stop archetype

8. Restart Archetype

Use Docker Desktop to restart Archetype, or use the following command from a new terminal window:

docker start -a archetype

9. Saving space

IF you have made a copy of your backup file in step 1 above and your site is running well, you can save disk space on your computer by removing the ~/archetype/archetype.tar from your archetype folder as it is no longer needed.

10. Back up regularly

If you are editing the content of your site it is advised to create a new backup from time to time to avoid accidental loss of your data.

Note that this process is not optimised and consumes a huge amount of additional disk space (twice the size of your original backup file). So please make sure you have enough space available on your machine before starting this process.

You can create a new backup by going to http://localhost:9080/digipal/search/index/ and clicking the 'Package your content' button at the bottom of the page. Please do not click a second time on the button.

You can refresh the page occasionally to check the progress. Eventually the red 'cancel' button will disappear.

Please don't use the 'download' button as this will create yet another copy, which is unnecessary and may fill up your disk.

Instead you can save the new backup, located in ~/archetype/static/archetype.tar.gz on a separate storage device according to step 1. Then delete it from your computer to save space.

Clone this wiki locally