Webinoly is just the perfect tool for NGINX experts. Give it a try!
+1 vote
1.1k views
by Rookie
I tried to clone my WordPress site to test new features.

Executed the commands:

> site dev2.mysite.com -clone-from = dev.mysite.com

> site dev2.mysite.com -env = local

> site dev2.mysite.com -ssl = on

Both sites are working fine. But when I tried to go to WP admin panel at dev.mysite.com/wp-admin it automatically redirects me to https://dev2.mysite.com/wp-login.php?redirect_to=https%3A%2F% 2Fdev .mysite.com% 2Fwp-admin% 2F & reauth = 1

I deleted dev2.mysite.com (site dev2.mysite.com -delete) but it doesn't help

1 Answer

0 votes
by Talented
selected by
 
Best answer

I have the same problem. I'd like to clone my production site to another new local domain but it affected my production records.

The problem is the option_value of option_name in (siteurl, home) in table dev_mysite_com.wp_options were changed to http://dev2.mysite.com

The workaround is you change it back to http://dev.mysite.com manually

by Rookie
Yes, I found a solution. But I think this is a bug in code
by Expert

If you want to report any bug, please describe the steps to reproduce it in a fresh/new installation.

by Talented

Hi QROkes,

This issue happened when the cloned site was SSL enabled.

Here are my steps to reproduce the problem:

You could see after the -ssl=on, we clone the site will affect the original records.

root@carger:~# webinoly -version

Webinoly version: 1.13.1

Current stack version: 1.5

root@carger:~# site dev.carger.tips -info

Type: WordPress

Status: Enabled

SSL: false

Access Logs: false

Force Redirect: off

Size: 198M

Cache: false

Multisite: false

WP Auth: true

Debug: true

Database: localhost

DB Name: dev_carger_tips

DB User: dev_carger_tips

DB Prefix: wp_

root@carger:~# wp db query "select * from dev_carger_tips.wp_options where option_name in ('siteurl', 'home')" --allow-root --path=/var/www/dev.carger.tips/htdocs/

+-----------+-------------+------------------------+----------+

| option_id | option_name | option_value           | autoload |

+-----------+-------------+------------------------+----------+

|         2 | home        | http://dev.carger.tips | yes      |

|         1 | siteurl     | http://dev.carger.tips | yes      |

+-----------+-------------+------------------------+----------+

root@carger:~# site staging.carger.tips -clone-from=dev.carger.tips

Site staging.carger.tips is now a successfull clone of dev.carger.tips

root@carger:~# wp db query "select * from dev_carger_tips.wp_options where option_name in ('siteurl', 'home')" --allow-root --path=/var/www/dev.carger.tips/htdocs/

+-----------+-------------+------------------------+----------+

| option_id | option_name | option_value           | autoload |

+-----------+-------------+------------------------+----------+

|         2 | home        | http://dev.carger.tips | yes      |

|         1 | siteurl     | http://dev.carger.tips | yes      |

+-----------+-------------+------------------------+----------+

root@carger:~# echo "If the SSL is not enabled in the cloned site, it would be ok"

If the SSL is not enabled in the cloned site, it would be ok

root@carger:~# site staging.carger.tips -delete

Delete Database [Y/n]?

Database of your site staging.carger.tips has been successfully deleted!

Site staging.carger.tips has been successfully deleted!

root@carger:~# wp db query "select * from dev_carger_tips.wp_options where option_name in ('siteurl', 'home')" --allow-root --path=/var/www/dev.carger.tips/htdocs/

+-----------+-------------+------------------------+----------+

| option_id | option_name | option_value           | autoload |

+-----------+-------------+------------------------+----------+

|         2 | home        | http://dev.carger.tips | yes      |

|         1 | siteurl     | http://dev.carger.tips | yes      |

+-----------+-------------+------------------------+----------+

root@carger:~# site dev.carger.tips -ssl=on

*************************************************************************************************

**  Please, be careful with the number of intents or certificates you try to get.              **

**  Let’s Encrypt provides rate limits to ensure fair usage by as many people as possible.     **

**                                                                                             **

**  If you are getting errors or having issues when trying to get a new certificate            **

**  read about the Let's Encrypt rate limit - https://letsencrypt.org/docs/rate-limits/        **

*************************************************************************************************

Please, be sure that the dev.carger.tips subdomain is currently pointing (DNS) to this server.

Certificate for dev.carger.tips already exist and found, wait while we configure your server to use it!

SSL have been successfully enabled for your site dev.carger.tips

root@carger:~# wp db query "select * from dev_carger_tips.wp_options where option_name in ('siteurl', 'home')" --allow-root --path=/var/www/dev.carger.tips/htdocs/

+-----------+-------------+-------------------------+----------+

| option_id | option_name | option_value            | autoload |

+-----------+-------------+-------------------------+----------+

|         2 | home        | https://dev.carger.tips | yes      |

|         1 | siteurl     | https://dev.carger.tips | yes      |

+-----------+-------------+-------------------------+----------+

root@carger:~# site staging.carger.tips -clone-from=dev.carger.tips

Site staging.carger.tips is now a successfull clone of dev.carger.tips

root@carger:~# wp db query "select * from dev_carger_tips.wp_options where option_name in ('siteurl', 'home')" --allow-root --path=/var/www/dev.carger.tips/htdocs/

+-----------+-------------+----------------------------+----------+

| option_id | option_name | option_value               | autoload |

+-----------+-------------+----------------------------+----------+

|         2 | home        | http://staging.carger.tips | yes      |

|         1 | siteurl     | http://staging.carger.tips | yes      |

+-----------+-------------+----------------------------+----------+

by Expert

Fixed in v1.13.2 released today!

Thanks for reporting this issue.

by Talented
I confirmed the issue was fixed. Thanks for fixing this!
Welcome to the Community site for Webinoly.

Our Optimized LEMP Web Server is a powerful set of commands for doing just about anything you could wish.

With Webinoly you can set up your NGINX web server in just one step.

* * * * * * *

To report a bug, please create a new issue on GitHub or ask a question here with the bug tag.
Webinoly Support Paypal Donations

PayPal · GitHub Sponsors · Bitcoin

It is very important that any visitor to the site read the disclaimer, terms of use and privacy and legal statement before start browsing.

...