Skip to content

Restoring an Archetype backup

Geoffroy Noël edited this page May 11, 2022 · 9 revisions

How do I restore an Archetype backup?

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

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 an 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

The first time you run this command, it may take several minutes before the site is 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 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) 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 that 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.

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 the terminal:

docker stop archetype

8. Restart Archetype

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

docker start 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 space disk space on your computer by removing the ~/archetype/archetype.tar from your archetype folder as it is no longer needed.

10. Create a new backup if needed

If you are editing the content of your site it is advised to create a new backup from time to time to protect your data from any accident.

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 data' 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