Syncing WordPress Files to LiteSpeed Production Server

To deploy or update your WordPress site hosted on a LiteSpeed server, you can sync files directly from a local development environment or a staging server. This ensures your production site reflects the latest changes while maintaining a clean and efficient file transfer process. By using rsync, you can securely copy only the changed files to the target LiteSpeed web root, minimizing downtime and saving bandwidth.

๐Ÿงน One-Time Move (With File Cleanup):

sudo rsync -avz --remove-source-files /usr/local/lsws/site.com/html/ user@remote-server:/usr/local/lsws/site.com/html/

This command copies all files and removes them from the source after a successful transfer. Use this if you’re migrating data.

๐Ÿ”„ Regular Sync (Without Deleting Source):

sudo rsync -avz /usr/local/lsws/site.com/html/ user@remote-server:/usr/local/lsws/site.com/html/

This keeps source files intact and is useful for deploying updates without data loss.

๐Ÿ’ก Use SSH key authentication and --progress if you want to monitor transfer status.