Usage
Usage
You can use the Remote Sync plugin to sync files between environments via both the Craft interface and the command line.
Craft Control Panel
To sync files via the Control Panel, you can find the Remote Sync interface in the Utilities
section of Craft:
The Remote Sync interface will let you view your synced files as well as push, restore and delete files:
Listed files
You'll see that there is some additional information listed with your files to help you keep track of when they were last taken and from where:
- Date: the date the file was pushed.
- Time: the time the file was pushed.
- Env: the environment the files were pushed from (development, production, ...).
- Version: the Craft version running on the instance that pushed the files.
- Size: the total size of the pushed file.
Filename formatting
Note that this information is encoded in the filenames of the files that are synced. That means that you shouldn't manually change the name of any files that the plugin created, otherwise it will cause errors.
Pushing files ꜛ
When pushing, you are sending a local copy of your database or asset volumes to your remote cloud destination.
The plugin will first create a local zip file of either your database or asset volumes then send that zip file to the destination.
If you have Keep an emergency backup
enabled in the settings, these local zip files will be kept, otherwise they'll be deleted after the files have been succesfully uploaded to the destination.
Restoring files ꜜ
This will pull down a copy of either your database of asset volumes from the remote destination and replace your local version.
Restoring is destructive ⚠️. You should always double check before restoring a database or asset volume that you're on the right environment.
Deleting files ˟
Deleting will remove the remote copy of either the database or asset volumes that you've previously pushed. No local data is deleted or replaced.
Syncing via CLI
It's also possible to push, restore and delete files via the command line:
- remote-sync/database Manage remote databases
remote-sync/database/delete Delete a remote database
remote-sync/database/list List remote databases
remote-sync/database/prune Prune remote database files
remote-sync/database/pull Pull remote database and restore it locally
remote-sync/database/push Push local database to remote destination
- remote-sync/volume Manage remote volumes
remote-sync/volume/delete Delete a remote volume
remote-sync/volume/list List remote volumes
remote-sync/volume/prune Prune remote volume files
remote-sync/volume/pull Pull remote volume and restore it locally
remote-sync/volume/push Push local volume to remote destination