WordPress Backup: Automatic and Secure Backup with Object Storage
Keyword: WordPress Backup
🧠 Technical Summary
This guide explains how to back up WordPress sites to S3 compatible Object Storage.
The purpose is to store media files and database independently of the server.
Steps; Includes permission settings, plugin usage, manual backup with s3cmd and automatic backup with cron.
📘 What Will You Learn in This Guide?
As WordPress sites grow, disk usage and risk of data loss increases.
In this guide, you will learn how to back up your data to secure, scalable and low-cost Object Storage.
We will apply plugin, command line and automatic backup methods together.
🔧 Prerequisites
The following should be ready:
- WordPress site running on Ubuntu
- LAMP or LEMP stack must be installed
- S3 compatible Object Storage (e.g. GenixNode Object Storage)
- Access Key and Secret Key information
1️⃣ Configuring WordPress File Permissions
Media files are in the wp-content/uploads directory.
This directory must be writable.
sudo mkdir -p /var/www/html/wp-content/uploads
- This command creates the uploads folder.
sudo chown -R genix_user:www-data /var/www/html/wp-content/uploads
sudo chmod -R g+w /var/www/html/wp-content/uploads
- These commands give write permission to the web server.
2️⃣ Method A: Backup with Add-on (UpdraftPlus)
It is the most practical solution for those who do not want to deal with technical details.
Steps:
-
Install UpdraftPlus plugin from WordPress panel
-
Go to Settings → UpdraftPlus Backups menu
-
Select S3-Compatible (Generic) as storage
-
Enter endpoint and bucket information
Example:
-
Endpoint: tr1.genixnode.storage
-
Bucket: site-my-backups
This method automatically backs up the database and files.
3️⃣ Method B: Manual Backup with s3cmd
Ideal for those who want more control.
- Installing s3cmd
sudo apt install s3cmd
s3cmd --configure
- This command installs and configures the s3cmd tool.
s3cmd ls
- This command tests the connection.
- Backup Media Files
s3cmd sync /var/www/html/wp-content/uploads s3://yedek-kovasi/medya-yedekleri/
- This command only loads changed files.
- Database Backup
nano ~/.my.cnf
[client]
user=veritabani_kullanicisi
password=veritabani_sifresi
chmod 600 ~/.my.cnf
mysqldump wordpress_db | gzip > db.sql.gz
s3cmd put db.sql.gz s3://yedek-kovasi/db-yedekleri/
- This process takes a compressed database backup.
4️⃣ Automatic Backup (Cron Job)
nano ~/wp-yedekle.sh
#!/bin/bash
DATABASE=("wordpress_db")
UPLOADS_DIR=("/var/www/html/wp-content/uploads")
BACKUP_DIR=/home/genix_user/tmp_backup
S3_BUCKET=s3://yedek-kovasi/otomatik/$(date +%F)/
S3_CMD="/usr/bin/s3cmd"
mkdir -p $BACKUP_DIR
rm -rf "${BACKUP_DIR:?}/*"
for DB in "${DATABASE[@]}"; do
mysqldump --defaults-extra-file=/home/genix_user/.my.cnf "$DB" | gzip > "$BACKUP_DIR/$DB.sql.gz"
$S3_CMD put "$BACKUP_DIR/$DB.sql.gz" "$S3_BUCKET"
done
for DIR in "${UPLOADS_DIR[@]}"; do
$S3_CMD sync "$DIR" "$S3_BUCKET"
done
bash
chmod +x ~/wp-yedekle.sh
crontab -e
0 3 * * * /home/genix_user/wp-yedekle.sh
- This cron takes automatic backups every night.
❓ Frequently Asked Questions (FAQ)
1. Why is Object Storage recommended? Provides server-independent, secure and scalable storage.
2. Does s3cmd sync delete files? No. If --delete-removed is added, it will delete it.
3. Does the backup affect performance? It has no effect if run at night.
4. Is a database backup necessary? Yes. The content and settings are in the database.
🏁 Result
With this guide, you have safely backed up your WordPress site to Object Storage. You learned the plugin, manual and automatic methods together.
🚀 GenixNode You can automate your backup processes immediately with the S3 compatible Object Storage infrastructure.

