WordPress copied website is being redirected to original domain

Follow

Comments

14 comments

  • Avatar
    Mike de Leeuw

    I wish I never had pushed on Copy Data. The copied website is being redirected to original domain and no way to get it back. We used backups, no luck.

    Can somebody tell me which files we have to check so the dahm redirect is gone?

    0
    Comment actions Permalink
  • Avatar
    Konstantin Annikov (Edited )

    Hello, 

    As it said in the article, first of all it is needed to connect new database to the copied WorPress website. For that, please go to Plesk > Websites & Domains > example.com > Databases and check what database name, username and password are defined here. Once you have these parameters, please define them in /var/www/vhosts/example.com/httpdocs/wp-config.php file (DB_NAME option for database name, DB_USER for database user and DB_PASSWORD for user's pasword)

    Then please insert the website's name in the same file. Just add WP_HOME and WP_SITEURL variables inside as it is described on WordPress official website: 

    https://codex.wordpress.org/Changing_The_Site_URL

    Also, it is needed to check the database of the destination website and pay attention to wp_options table. 

    Reply me if you need more information on this. 

    0
    Comment actions Permalink
  • Avatar
    Martine Kooi (Edited )

    The resolution given does not work properly either. You say the best way to copy a WordPress site in order to avoid the issue described in this article is to use WordPress Toolkit Cloning feature. And that the WordPress Toolkit will handle the changes automatically. Unfortunately cloning the website gives the same problem. In first instance it looks like everything works fine, but since a few months the cloned website switches back to the original (the cloned) domain after a few days. 

    Please solve this Plesk issue. With kind regards, Martine

    0
    Comment actions Permalink
  • Avatar
    Alexandr Nikolaenko

    Hello,

    There are no preconditions when Plesk or WordPress Toolkit could revert back changes in cloned WordPress instance. Especially considering, that it was working fine for several months.
    Most probably the backup of staging website was restored to production instance and overwrote database and "wp-config".

    0
    Comment actions Permalink
  • Avatar
    Martine Kooi (Edited )

    I think you misunderstood me Alexandr Nikolaenko.

    The cloned Wordpress websites are not redirected after working for several months. 

    It is SINCE a few months that cloned Wordpress websites get a redirect to the original domain after a few days... Before (let's say February, March 2019) I did not have this problem.

     

    0
    Comment actions Permalink
  • Avatar
    Nikita Nikushkin

    Hi @Martine Kooi,

    If the issue can be reproduced on your server in the following way:

    1. Clone a website
    2. After a few days, a redirect from the cloned website to the initial one appears

    we will be glad to investigate this issue deeper

    Please create a request to the Support Department:

    How to submit a request to Plesk support?

    0
    Comment actions Permalink
  • Avatar
    Thomas

    HI @Nikita Nikushkin,

    I've had a similar experience, however it does not seem to be a redirect that happens.

    The entire webspace seems to be "copied" from the initial source, as if it had never been cloned through the WordPress Toolkit Cloning feature, just simply copied over.

    The database related to the "new clone" seems to have vanished, the wp-config files seems unchanged as mentioned above, so when opening the page it simply fetches the config for the source page. And thus opens and redirects to the source page rather than opening the cloned page. 

    Steps used to clone:

    1. Create new webspace with new domain (it installs WordPress as default)

    2. Go to "source webspace" Select "Clone" from the WordPress Toolkit

    3. Select "use existing domain or sub domain"

    4. Select the new webspace/ domain that was just created

    5. Hit start.

     

    Everything seemed fine at this point, new page loads ok with new domain, changes can be done, and no changes is done to the source page (so they are acting independently).

    This was done on sunday 23. june. I noticed the issue just today friday 28th of june

    0
    Comment actions Permalink
  • Avatar
    Nikita Nikushkin

    Hello @Thomas,

    I followed your steps but was not able to reproduce the issue - cloning feature works as expected

    However, please make sure that all Plesk updates are installed and try to reproduce the issue again

    If it still occurs we would be glad to take a look at the issue - please submit a request to the Support Department

    0
    Comment actions Permalink
  • Avatar
    Scott Ashman (Edited )

    We are having the same issue with cloning reverting.  The clone works fine for 4 or 5 days and then the wp-config is overwritten, pointing back to the site that it was cloned from.  The DB associated with the site reverts sometimes as well.  When we detatch and reattach the wordpress instances it seemed to have helped, although we still run into it.  We've had approximated 10 sites revert over the last few months, which is a big issue as they are all production.  There is certainly an issue with cloning and we have opened up two tickets.  Both times, they were not able to help us as the issue only happens several days after the clone.

    Logs are not very helpful, but the problem happens on a physical hosting updated event (I believe).

     
    We were able to trace the time when the wp-config.php file was overwritten (timestamp) with the log entry.  Regretfully, the logs don't get very specific.

    I'm glad we are not the only one with the issue. 

    0
    Comment actions Permalink
  • Avatar
    Nikita Nikushkin

    Hello @Scott Ashman,

    Support Department tried to reproduce the issue as well, however, it is reproduced under specific conditions only, thus it is hard to catch it

    Nevertheless, we had a case when a WordPress Backup Plugin, e.g. "UpdraftPlus", led to such behavior

    Plesk clones 1:1. Thus, the configuration and settings of the plugin are copied as well. It leads the situation that the plugin contains information about configuration files from the old WordPress instance. After some time, this plugin replaces the config file for the domain as it differs from one presented in the plugin repository

    If it is not your case, I suggest to perform the following steps on your server:

    1. Create a new domain
    2. Install WordPress on it
    3. Remove all plugins
    4. Clone a WordPress website
    5. Monitor the config file

    If the issue was not reproduced, check the plugins on the instances where the issue was found. Some of them could lead to such behavior

    If the issue occurred again, please create a new request to the Support Department with providing this information

    We will be glad to take a look at your server and find the root cause of the issue

    0
    Comment actions Permalink
  • Avatar
    Mike de Leeuw

    My first post is from March 01, 2019 and you still have not fixed this....

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Mike,

    The behavior from this article is an expected one, Website Copying makes a copy as is.

    As described in Resolution section, for WordPress copying there's a special function: https://docs.plesk.com/en-US/onyx/administrator-guide/website-management/wordpress-toolkit/access-wpcli.73391/#cloning-a-wordpress-website

    0
    Comment actions Permalink
  • Avatar
    Scott Ashman

    Appreciate the reply Ivan.  I've looked over the plugins on the sites effected and there isn't anything that should be touching wp-config.php.  Plus, please note that the database listed in wp-toolkit is also reverted, which a plugin wouldn't be able to modify.  I can only see that changing if perhaps you are re-scanning wp-config.php and setting the db based on that.  

    Finally, we always see this event when it happens :

    server1.iad1.xxx.com APP 3:45 PM
    Some events have taken place at server1.iad1.xxx.com
    Physical hosting updated

    These are all controlled sites, the end user has no access.

     

     

    0
    Comment actions Permalink
  • Avatar
    Julian Bonpland Mignaquy

    @Scott Ashman, could you please create a new request to the Support Department in order to take a deeper look.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request