1

I needed to create a second instance of a craft 2.0 instance and so I copied the current instance to a new instance. I followed the directions found here: https://craftcms.com/guides/duplicating-a-craft-site

The structure is like this:

/var/www/html/my_site (original - contains the craft and public folders)

copied to:

/var/www/html/new_folder/my_site (this contains the craft and public folders)

There is a reverse proxy (Apache) that handles routing of the URL's. The website comes up with no problems. But, I cannot sign into the site to administer the site. All I see is "An unknown error occurred." There is nothing in the craft.log in the instance that indicates what the unknown error is.

Is there a value in the database tables that might be incorrect? I have scanned for references to the original path and I don't find anything. The document root in the Apache config files for the instance is correct. There was a recommendation to delete the runtime folder after copying a Craft install and I have done that but I still get the error and there are no errors in the craft.log file.

One last interesting observation. When I try the admin URL for the copied site e.g. http://copy.mysite.com/admin the login page for the original site is displayed e.g http://orig.mysite.com/admin/login. So, somewhere there is a reference lurking to the old site I copied. I have changed general.php, db.php and search for references to the old host name but found nothing.

  • Have you cleared the storage / cache from the copied instance? You may still have some cached data pointing to the original instance. – Campiotti Nov 29 at 13:03
  • Check the craft/storage/runtime/logs folder for the underlying message for the "Unknown error occurred" flash. There might be something in there that helps. – Brad Bell Nov 29 at 19:31
  • Cleared everything under the storage folder. What I see in the console is: Access to XMLHttpRequest at 'https://orig.mysite.com/index.php?p=admin/actions/users/login' from origin 'https://copy.mysite.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. I changed the general.php file to point to copy.mysite.com so why does the login page still reference orig.mysite.com? Where is that URL coming from? – Pete Helgren Dec 2 at 19:23
  • And, also see this in logs: 2019/12/02 21:14:00 [error] [exception.Craft\HttpException.503] exception 'Craft\HttpException' in /var/www/html/copy/craft/app/etc/web/WebApp.php:972 Stack trace: #0 /var/www/html/copy/craft/app/etc/web/WebApp.php(263): Craft\WebApp->_processUpdateLogic() #1 /var/www/html/copy/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest() #2 /var/www/html/copy/craft/app/index.php(73): CApplication->run() #3 /var/www/html/copy/public/index.php(19): require_once('/var/www/html/c...') #4 {main} REQUEST_URI=/ --- – Pete Helgren Dec 2 at 21:22
1

So I am going to answer my own question here: The solution was that something, I don't know what, what messed up in the DB. So I dropped the DB and then copied it over again from the original. That fixed it. I never got an indication in the logs that the DB was the issue I just decided to start with replacing it and then work backward if necessary.

Thanks for the tips. At least it eliminated the obvious issues.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.