How do I back up and restore containers in Container Station?
Applicable Products
Container Station
Overview
Container Station offers comprehensive capabilities for exporting, importing, and managing container images and their associated data. These functions are critical for various operational scenarios, including storage driver migrations, system recovery, and data protection.
During the conversion process of the storage driver from overlay to overlay2, the existing container data may need to be restructured or reconfigured, which could involve removing and re-importing containers. Backing up containers before conversion ensures that no data is lost, and restoring them afterward allows you to seamlessly transition to the new storage driver without compromising the operational state of the containers.
This FAQ provides detailed guidance on these processes, explaining the reason behind steps like container removal and re-import when necessary, such as during storage driver conversions.
Prerequisites
Before proceeding with backing up and restoring your containers, ensure that you have reviewed the process for converting the container's storage driver from overlay to overlay2. For details, see How to convert the storage driver from overlay to overlay2.
Procedure
Backing up or exporting a container
- Log in to your QNAP device.
- Open Container Station.
The Overview page appears. - Click Volumes.
- Identify the volume linked to the container you want to back up.
- Under Actions, click
> Container in Use.
- Click the container you want to back up and remove.
Container Station redirects you to the Details page of the container. - Click the drop-down menu icon next to Edit or Start.
- Click Export.
The Export Container window appears. - Specify a file name.
- Optional: Enable Compress Image.Note/Tip
- Selecting this option saves the container or image as a .tar.gz file.
- A
.tar
file is an uncompressed archive format used to bundle multiple files and directories into a single file, while a.tar.gz
file is a.tar
archive that has been compressed using the gzip compression algorithm, resulting in a smaller file size.
- Specify a location to export the container or image.
Location Action Your local device Click Local Computer. Your QNAP device - Click Local QNAP device.
- Click the
.
The Select Folder window opens. - Select a directory to export the container or image.
- Click Apply.
- Click Export.
Container Station exports the container. - Save the file to your local device.
Restoring or importing a container
When you restore a container, especially after a storage driver conversion, it is crucial to remove the original container before re-importing it to maintain data integrity and compatibility. This process ensures that the new container is built using the updated storage driver, thereby avoiding potential inconsistencies.
Removing the container
- Open Container Station.
The Overview page appears. - Click Containers.
- Identify the container you want to remove.
- Under Actions, click
.
- Click Remove.
The Remove Containers window appears. - Optional: Select Automatically remove anonymous volumes associated with the container.NoteEnabling this option prevents the original volume from being mounted when you import the container.
- Click Yes.
Container Station removes the container.
Restoring or importing the container
- Click Containers.
- Click Import.
The Import Container window appears. - Locate the container on the local computer or on the QNAP device.
Location Action Your local device - Click Local Computer.
- Click
.
A file explorer window opens. - Select the container to import.
- Click Open.
Local QNAP device - Click Local QNAP device.
- Click
.
The Select a source image file window appears. - Locate and select a container to import.
- Click Apply.
- Click Import.
Container Station imports the container data. - Click Advanced Settings.
- Click Storage.
- Reattach the previously identified volume to the imported container from the drop-down list.NoteMake sure you verify the volume ID if reusing data from the same container to ensure correct data mapping.
- Click Apply.
- Click Next.
The Summary window appears. - Verify the container settings.
- Click Finish.
Container Station creates the container with the new storage driver.