AdminsForum

CyberPanel Websites & OpenLiteSpeed Guides

Guide CyberPanel WordPress Staging (Clone): Why It Came Out Empty and How We Fixed It

Started by JAY 0 replies 102 views
1JAY
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
#1
CyberPanel WordPress Staging (Clone): Why It Came Out Empty and How We Fixed It

A staging site is a private copy of your live WordPress where you can test updates, a new theme or a plugin before touching the real site. CyberPanel has a one-click Clone/Staging button for this. We used it on our test WordPress (
Code:
cyber.adminslab.com
) and it took two tries and a few fixes to get a staging copy you can actually trust. Here is all of it.

Before you start
  • Create a DNS A record for the staging name (ours:
    Code:
    staging.cyber.adminslab.com
    , at Cloudflare, DNS only) so CyberPanel can issue SSL for it.
  • Run the check in Step 1 first. It decides whether your clone works at all.

Step 1: Make sure /usr/bin/wp exists
CyberPanel's staging code calls WP-CLI at the fixed path
Code:
/usr/bin/wp
. Many people (and the official WP-CLI install steps) put it in
Code:
/usr/local/bin/wp
instead, which is what we did in our WordPress install guide. Check:
Code:
ls -l /usr/bin/wp /usr/local/bin/wp
Ours said
Code:
ls: cannot access '/usr/bin/wp': No such file or directory
. The staging code first checks that
Code:
wp
works (it does, through your PATH), so it doesn't install its own copy, and then every later command fails quietly. Fix it with a link:
Code:
ln -s /usr/local/bin/wp /usr/bin/wp

Step 2: Start the clone
Open your website in Websites > List Websites > Manage and click Clone/Staging. The page asks for one thing, the staging domain:
[Image: attachment.php?aid=518]

The staging site is created as a child domain of the live site, in its own folder (
Code:
/home/cyber.adminslab.com/staging.cyber.adminslab.com
) with its own new database. Type the name and click Start Cloning. The progress bar shows "Creating domain", "Creating and copying database", "Fixing permissions" and so on.

A minute later the panel reported success. On our first try, that message was wrong:
[Image: attachment.php?aid=519]

Our first run (before Step 1): "Successfully Installed", but the staging folder held only CyberPanel's
Code:
index.html
, 8 KB in total. No WordPress, no database copy. The only clue in
Code:
/home/cyberpanel/error-logs.txt
was the SSL step. Always check after a clone:
Code:
du -sh /home/yourdomain.com/staging.yourdomain.com ls /home/yourdomain.com/staging.yourdomain.com
To retry, remove the empty child domain and its folder first. From SSH:
Code:
cyberpanel deleteChild --childDomain staging.yourdomain.com rm -r /home/yourdomain.com/staging.yourdomain.com
Second run (after Step 1): the folder had the full site (120 MB) and
Code:
wp-config.php
pointed to a new database. That's when we found the next problems.

Step 3: Fix the four leftovers
Run these as the site user from the staging folder. Ours:
Code:
cd /home/cyber.adminslab.com/staging.cyber.adminslab.com S='sudo -u cyber2602 wp'

1. Stale object cache: WordPress still thinks it's the live site.
Code:
$S option get siteurl
returned
Code:
https://cyber.adminslab.com
, the live address. But the staging database itself already had the staging address:
Code:
$S db query "SELECT option_name,option_value FROM wp_options WHERE option_name IN ('siteurl','home')"
returned
Code:
http://staging.cyber.adminslab.com
for both. The difference came from the Redis object cache: the clone copied the live site's LiteSpeed Cache settings, including Redis database 2, and most likely the staging copy cached its options while they still held the live URL, before CyberPanel replaced them. Give the staging site its own Redis database and flush it:
Code:
$S litespeed-option set object-db_id 3 $S cache flush
After that,
Code:
option get siteurl
matched the database. (Don't flush while staging still uses the live site's database number:
Code:
wp cache flush
empties the whole Redis database, live cache included. See Redis object cache on CyberPanel.)

2. http instead of https. The staging database had
Code:
http://staging...
although CyberPanel had issued SSL. Replace it everywhere:
Code:
$S search-replace 'http://staging.cyber.adminslab.com' 'https://staging.cyber.adminslab.com' --all-tables --report-changed-only
WP-CLI made 9 replacements.

3. Google can index your staging site.
Code:
blog_public
was
Code:
1
(copied from live). Turn on "Discourage search engines":
Code:
$S option update blog_public 0
After purging LiteSpeed Cache (
Code:
$S litespeed-purge all
) the staging pages carried
Code:
<meta name='robots' content='noindex, nofollow'>
. For a real lock, also password-protect the staging site.

4. CyberPanel's index.html. The staging folder still had the "CyberPanel Installed"
Code:
index.html
next to WordPress's
Code:
index.php
. Delete it:
Code:
rm index.html
.

After these fixes, the staging copy was correct:
[Image: attachment.php?aid=528]

Staging now answered with its own https address,
Code:
blog_public 0
, its own Redis database (
Code:
3
). The live site was untouched:
Code:
https://cyber.adminslab.com
,
Code:
blog_public 1
.

Things to know
  • Same Linux user. Staging runs as the live site's user and counts toward the same package limits (a domain, a database). See packages and limits.
  • No automatic push back. Changes you make on staging stay there. Copy them to live yourself (or redo them on live once they work).
  • Cron. Our live site had WP-Cron disabled and a real cron job (cron guide); the staging
    Code:
    wp-config.php
    was rebuilt without
    Code:
    DISABLE_WP_CRON
    , so staging uses normal WP-Cron. That's fine for testing.
  • Emails. A staging copy can send real emails (order mails, newsletters). Disable mail plugins or use an SMTP catcher on staging.
  • Delete it when done.
    Code:
    cyberpanel deleteChild --childDomain staging.yourdomain.com
    , then remove the folder and the staging database.

More CyberPanel guides
Tested on CyberPanel 3.0 (build 8, OpenLiteSpeed edition) on Ubuntu 24.04, October 2026. Menu names can change slightly between versions.

Attached Files

Image(s)
           
Reply

Messages In This Thread
CyberPanel WordPress Staging (Clone): Why It Came Out Empty and How We Fixed It - by JAY - 10-26-2026, 10:43 AM
Possibly Related Threads…matched by title
Replies:0Views:7
Replies:0Views:13
Replies:0Views:18
Replies:0Views:15
Replies:0Views:103

Users browsing this thread: 1 Guest(s)
Forum Jump: