Restoring Backup Files on FileMaker Cloud for
Prerequisites
- Your applications are hosted with FileMaker Cloud for AWS 1.17. This approach may vary for other versions of FileMaker Cloud.
- The FileMaker Cloud for AWS Admin Console is working
- You have FileMaker Cloud for AWS instance root credentials
- Established SSH access to the FileMaker Cloud for AWS instance
- Basic proficiency with the Linux command line
Establish SSH Access
This part of the procedure should only need to be done once per user requiring access. Basically, you need to grant access on the server for the user that will be logging in to restore the backup files.- Whitelist the IP address of the user. This is completed via the AWS management console.
- The administrator should navigate to the
~/.sshdirectory on the local machine and usessh-keygen -t rsa -f hostname.keyto create a public and private key pair. Copy thehostname.key.pubpublic key to the server. - Now the admin should be able to use the below instructions to
sshto the server to restore backup files.
Attach the Backup Files(s)
The first step is to attach the backup using the FileMaker Cloud for AWS Admin Console. Once the backup file(s) are attached, they will show up in the Linux directory structure.- Log into FileMaker Cloud for AWS Admin Console.
- Navigate to the Backups tab.
- Preserve the desired backup by checking snapshot and clicking Preserve Backup.
- From sidebar, select Preserved Backups.
- Check the desired snapshot and click Attach Snapshot.
- Click through the dialog and expect to wait several minutes, especially for large files.
- Close the production file(s) that will be replaced by the backup using the Admin Console.
Move and Rename the Backup File(s)
Next,ssh into the FileMaker Cloud for AWS instance, move the attached backup to the production directory, and rename it. Directory paths specified below assume a standard installation. Adjust paths according to particulars of your configuration and filename(s).
- ssh to the FMC server:
ssh -i ~/.ssh/hostname.key username@hostname.domain.com
- Establish session using sudo privilege:
sudo -s
- Should now be at # prompt
- Change to directory containing backup files. These will be the files that were attached using step 5 above (Attach Snapshot):
cd /media/Data/Databases/
- Copy backup file(s), preserving permissions (
-p)cp -p filename_appendedTimestamp.fmp12 /opt/FileMaker/FileMaker\ Server/Data/Databases/
- You could optionally confirm that the copy command worked by listing the files in the production directory:
ls -la /opt/FileMaker/FileMaker\ Server/Data/Databases/
- Remove the original production database file(s):
rm /opt/FileMaker/FileMaker\ Server/Data/Databases/filename.fmp12
- Or if you want to be extra cautious you can just rename it and delete it later:
mv /opt/FileMaker/FileMaker\ Server/Data/Databases/filename.fmp12 /opt/FileMaker/FileMaker\ Server/Data/Databases/filename_OLD.fmp12
- Rename the backup(s) to the original name:
mv /opt/FileMaker/FileMaker\ Server/Data/Databases/filename_appendedTimestamp.fmp12 /opt/FileMaker/FileMaker\ Server/Data/Databases/filename.fmp12
- Confirm by listing:
ls -la /opt/FileMaker/FileMaker\ Server/Data/Databases/
- Open the copied backup file(s) in the FMC for AWS Admin Console
Optional Restore of Externally Stored Container Data
If you have external stored container data in your solution then that may also need to be restored. In some cases you will only need to restore the database files that reference the externally stored container data. Use these commands to remove the production container data and copy the backup data to the correct directory. The paths provided are samples only; adjust them based on your servers configuration and filename(s) for your installed applications. In these examples the files are stored using the secure option. Paths may be different if the files are stored using the non-secure external storage.- Consider copying the production container data just in case you make an error. Make a temp directory first:
mkdir /opt/FileMaker/FileMaker\ Server/Data/Databases/RC_Data_FMS/filename_OLD
- Then copy the production container data there, preserving permissions and using recursion:
cp -pr /opt/FileMaker/FileMaker\ Server/Data/Databases/RC_Data_FMS/filename/* /opt/FileMaker/FileMaker\ Server/Data/Databases/RC_Da_FMS/filename-OLD/
- Remove the production container data (recursively and forced with -rf. Warning! This cannot be undone! -rf is extremely dangerous as it will delete all directories and files in the specified directory with no confirmation. Change to the directory first so that there less risk of deleting more than you want):
cd /opt/FileMaker/FileMaker\ Server/Data/Databases/RC_Data_FMS/ rm -rf filename/
- Copy backup container data recursively, preserving permissions (
-pr):cp -pr /media/Data/Databases/RC_Data_FMS/filename_appendedTimestamp/* /opt/FileMaker/FileMaker\ Server/Data/Databases/RC_Data_FMS/filename/
- After confirming that your restored files have the required container data, you can remove the backup of the production containers you made in the first step:
cd /opt/FileMaker/FileMaker\ Server/Data/Databases/RC_Data_FMS/ rm -rf filename_OLD/