If you are migrating an existing PMS server to Kubernetes, you can use a custom initContainer.script to import your existing Library directory.
Important: The script must include a check to exit early if the database already exists to prevent overwriting data on pod restarts.
Example: Fetching database from a web server
This script uses curl to download a compressed archive from a URL and extract it to /config.
#!/bin/sh
echo "fetching pre-existing pms database to import..."
if [ -d "/config/Library" ]; then
echo "PMS library already exists, exiting."
exit 0
fi
apk --no-cache add curl
curl http://example.com/pms.tgz -o pms.tgz
tar -xvzf pms.tgz -C /config
rm pms.tgz
echo "Done."
#!/bin/sh
echo "fetching pre-existing pms database to import..."
if [ -d "/config/Library" ]; then
echo "PMS library already exists, exiting."
exit 0
fi
apk --no-cache add curl
curl http://example.com/pms.tgz -o pms.tgz
tar -xvzf pms.tgz -C /config
rm pms.tgz
echo "Done."