Moving shopworn 5 from shop.domain.com to www.domain.com/shop

Hi.

In files on the server I have directories “shop” and “wp”. The hosting is configured that “shop” is being used by subdomain “shop.domain.com” and “wp” (which is a wordpress installation) is used by “www.domain.com”. 

I have copied /shop to /wp/shop. Both installation at this point use the same database. The I opened “shop.domain.com/backend” and configured “host” from shop.domain.com to www.domain.com and “path” to /shop.

At this point I am able to open the shop at “www.domain.com/shop” as well backend at “www.domain.com/shop/backend”, but the system get 404 on a lot of tries to get important resources from the server.

What am I doing wrong and how can I do what I want?

Hi rreimche,

did you clear the whole cache after changing the host entry? If not do so. And it’s a pretty bad idea to share a database between Shopware and Wordpress. Shopware should have it’s own database. 

They do use different databases. It’s just the 2 shopware installations that use the same database. 

Actually, my algorithm was like this:

  • copy files

  • change host and path

  • open at new locatio, see 503

  • play with php settings (opening the old location’s backend), get something working

  • remember to clear cache, clear it, something more works, but it’s still unusable. 

I’ll try now again to change settings on the old location then purge cache then open new location…

Well… it didn’t help…

When I open the new shop location, there are some problems about loading stuff from www.domain.com/[shopware_files] and not from www.domain.com/shop/[shopware_files]. One could suppose that I have forgotten to change “path” in the settings, but I didn’t: https://www.dropbox.com/s/0yp3ihvza5rxcvo/Screenshot%202016-09-10%2016.13.03.png?dl=0

And when I open www.domain.com/shop/backend I get 404 loading a lot of stuff. The system tries to load it from http://www.domain.com/[path_to_files_on_the_server_root_related]/[shopware_files]. For example: 

http://www.domain.com/www/htdocs/[login_on_server]/domain.com/shop/themes/Backend/ExtJs/backend/_resources/resources/css/extra-icon-set-02.css?201607251359

when the right URL would be (I guess)

http://www.domain.com/shop/themes/Backend/ExtJs/backend/_resources/resources/css/extra-icon-set-02.css?201607251359

As you understand, I use [something] here as a substitute for real values.

 

UPDATE: when opening www.domain.com/shop, the system also has some 404 errors as when opening /shop/backend

UPDATE: to make it more clear… the 404s when there is usage of server path instead of url are about loading resources from the server path of OLD installation…

Could you send us a screenshot of the shop settings? ( Basic settings > Shop Settings > Shop ) . You should leave the “virtual path” setting empty.

I experienced the same error that Shopware tries to load the resources from an url containing the server root path when moving a shop and I forgetting to clear the cache. Make sure you cleared the whole cache ( not just the template cache ). I would recommend running the clear_cache.sh script in _Shopware_Root_/var/cache/clear_cache.sh.

OK, here are the screenshots (spaces are left with intention for the forum not to substitute links with images): 

https: //www.dropbox.com/s/3zpa0329ecuy0hh/Screenshot%202016-09-11%2020.31.33.png?dl=0
https: //www.dropbox.com/s/1kkf2rmnev81td1/Screenshot%202016-09-11%2020.32.53.png?dl=0

 

I cleared the case via Settings > Caches/Perfomance > Cache. Here I checked everything and emptied it. I also have generated the template.

Ok then login via FTP and rename the folder in /var/cache/ called production_XXX_ to something else ( remeber the original filename so you can move it back properly if needed ).
Then try to load the backend. 

The settings are correct. You can clearly see that Shopware is still looking for the files in the old directory ( […]htdocs/[login_on_server]/domai n.com/shop/the mes/[…]. The wp folder is missing. 

1 „Gefällt mir“

There vere 3 folders of that format. I added an underscore to the beginning of each of their names and voila! It works.

Thank you very much, simkli, you made my day. I would probably never find this it out alone and it would have taken much more of my time to solve it :)

 

By the way, should I delete these folders now?

That’s nice to hear  Smile

@rreimche schrieb:

By the way, should I delete these folders now?

Yes you can delete them now. Just in case Shopware would’ve thrown a Doctrine error after renaming them you’d had to move them back. But that didn’t happen so it’s safe to delete them.