Jump to content

Moving Prestashop 1.5 from subfolder to the domain root


Recommended Posts

Hello Community ;)

 

I would like to move my shop from the subfolder (mydomain.com/prestashop) into my server root (to make it accessible via mydomain.com) [all on same server, same domain, same database]

 

I am on Prestashop 1.5

 

Would you mind to explain step by step what to do?

What files or menus in back-office need to updated, and with what?

Is that risky?

 

Many many thanks for your help!

 

Best regards

Miki

Link to comment
Share on other sites

Hello PrestaShop Forum,

That looks like something hard to be donne moving the shop from folder to root on the same server.

I have found answer by tozama concerning PrestaShop 1.4 :

tozama

Posted 21 September 2011 - 07:27 PM

I just finished all my setup+configuration inside a "catalog" folder and just successfully copied it all to the root of my public_html directory. My Presta Version is 1.4.4.1.

 

Some/most of this is a repeat of above posts but I see they date back in some cases 2009 so here's the summary of what I did:

 

1. Using file manager in CPanel on my server I made a compressed file of the inside of my "Catalog" folder (the entire Presta website I made started in "www.mysite/Catalog/") called "catalog.zip".

DO NOT just rightclick on "Catalog" folder and compress it. Doing this will create yet another "catalog" folder = exactly what you already have!!!! Go INTO/INSIDE the folder, then select all the sub-folders and files, and then right click - compress.

 

2. A zip file will appear now inside your current shop's root.

I moved that zip file holding my entire Presta shop to the root of my server's public_html.

You could download the zipfile, then upload it to your public_html root if you prefer.

 

3. Still in CPanel File Manager move to your root of public_html.

unzip/uncompress it from within your root of public_html.

 

Now you still have your working copy inside "www.yoursite/Catalog/" and ALSO the second copy to now get activated.

This leaves you some safety until you see all works well.

 

4. Still in CPanel File Manager in your new root version of your shop, go into the folder called "Config".

Download or edit online if you want the "settings.inc.php" changing:

 

from define('__PS_BASE_URI__', '/your-old-presta-subfolder-name/');

 

to

 

define('__PS_BASE_URI__', '/');

 

Save or overwrite the file.

 

5. Now try going into your admin back office through the root version www.mysite/admin/.

It should allow you inside BUT you're not done yet.

 

6. Now go to Preferences -->SEO & URLs. Scroll way down and make sure PS directory only shows /

7. Go to Tools ---> Generators and click on the "Generate htaccess" then "Generate robots.txt" to sync those files.

 

If you skip the last step your front office site will still point to the old locations and the robot text will as well.

 

8. Go into "Modules" and fix any payment areas that require your specific URLs if required.

9. Go to PayPal.com and/or Google.com if you use them as payment gateways and again revise their settings URLs to match your new one.

 

After testing your new rooted site enough you could delete the old one or maybe just set it to "catalog mode" in Preferences --> Products to make it there for backup but not usable for ordering.

 

I will delete mine after about 2 weeks of testing my root one.

 

 

But in PrestaShop 1.5 there are some differences:

A.

file "settings.inc.php" in PS1.5 has no such line : ('__PS_BASE_URI__','); (? so where is it?)

B.

htaccess generator not existe anymore in PS1.5 : this is automaticaly generated file. so how to regenerate this ?

 

Any one of the 300.000 forum members :-) have an idea how to proceed, please?

 

Many thanks!

Miki

Edited by yasuhiro (see edit history)
Link to comment
Share on other sites

  • 1 month later...

I'm about to do the same thing, so I'll check, but I think you just change the line:

 

define('_PS_DIRECTORY_', '/prestashop/');

to

define('_PS_DIRECTORY_', '/');

 

H, Thanks for your post!

Did it worked for you?

 

I have failed moving my shop from subfolder to the root.

The new installation was still pointing to the old folder. Maybe I was a single click from the success? I do not know. Hard for me to find out.

 

As far I have abandoned the idea to move, and I have put in place a landing page directing visitors to the shop.

My shop is running and I do not want to experiment to much having fear the shop will crush if I mess up the code.

 

Anyhow the problem is interesting so I'll test this on another server, just to learn how it works.

 

@Scott J, if you can share your experience it would be nice ;)

 

Thanks!

Link to comment
Share on other sites

You have the right idea, I downloaded the entire shop to my computer using my FTP program, then uploaded to the root, now simply enter the BO and go to Preferences, SEO & URL's and change the Base URl.

The back office does not care what folder it is in its how you enter, if it used to be mydomain.com/shop/admin it will now be mydomain.com/admin.

 

On another note the define ps_directory was basically moved from the settings.inc.php to the database in 1.5, you can find it here. `ps_shop_url`

 

 

You may also want or need to edit ps_configuration in the database and edit any links that point to the old sub domain.

  • Like 1
Link to comment
Share on other sites

Well still no luck for me. I copied all of the original sub directory down to my computer - aiming to keep the sub directory as a safeguard until the root version was working, then uploaded to the root of the store. After changing the url to the root in ps_shop_url - via php admin - I could log into the new admin and all appeared to be ok.

 

However, although the home page appeared ok, none of the other pages would show; just blank white in a browser; although adding a new test product that showed! Something to do with the .htaccess file I think? Looking at the instructions on Template Monster, I see they say to change the domain to root before moving the files out to the root of the domain. Would doing this change the automatically produced .htaccess file now that doing this manually has been removed in 1.5? Or just change the shop root in the database as I did anyway?

 

I just had to revert everything to running in the sub folder again - breathing a sigh of relief once the shop appeared again! But the pages still do not show unless I set the templates to be updated now.

 

Are there any other definitive step by step instructions on moving 1.5 from a sub folder to the root of a domain?

 

Thanks

Peter

Edited by Peter Phelan (see edit history)
Link to comment
Share on other sites

I did this when I first did a clean install of 1.5.

I was testing it out in a subfolder like: www.mydomain.com/prestashop15/store

First thing I did was go into BO and to SEO & URLs and change Base URl to /store/

Then I went into my server folders and moved the whole store folder directly to my root folder.

So now it is www.mydomain.com/store.

That's all I had to do. If you do it backwards and move the folder on your server first, you won't be able to access your BO.

Link to comment
Share on other sites

I have moved/copied my site to a different folder 3 times and never had an issue with the BO as it does not care where you have it its all about how you access it.

The shop URL only points to the Front Office not the admin section.

I copied my entire site from shop to shop2 and shop 3 and the only thing that I had to do was use mydomain.com/shop2/admin or shop3/admin to access the admin section, you need to change the shop URL for the front office.

Once you have changed the shop url you need to generate a new .htaccess file in 1.4, tools, generators, in 1.5 just go to Preferences SEO & URL's and click save in the SEO & URL's section.

Before writing this I did a test and emptied my .htaccess file for a 1.5 test site I have clicked on save in SEO & Url's and the .htaccess file was re-written.

 

 

Note: the reason for the copies, shop2 was updated to 1.4.9, shop3 was updated to 1.4.9 then 1.5.2 I also have a shop15 that is a fresh install for testing 1.5.

Link to comment
Share on other sites

Well still no luck for me.

However, although the home page appeared ok, none of the other pages would show; just blank white in a browser;

Peter

 

@Peter

 

The reasons of getting white page are unknown until you ask your Presta configuration to show up what is going on:

 

Find this file: config.inc.php (open with a simple text editor)

The file is here (via ftp access): ROOT > config > config.inc.php,

Now: change line @ini_set('display_errors', 'off');

to @ini_set('display_errors', 'on'); (save!)

 

Refresh your white Presta page in your browser.

Now you are able to read the exact error and you know what to fix.

Link to comment
Share on other sites

You may also want or need to edit ps_configuration in the database and edit any links that point to the old sub domain.

 

@tdr170

 

This is maybe what is the harder step in entire moving shop procedure: accessing the database and editing it properly.

 

Is there a fixed list of the links that point to the shop domain?

[Or this list is or may be fluent depending on everybody's shop installation?]

 

Thank you

Link to comment
Share on other sites

In the database there are 2 areas that hold references to your shops domain in 1.5, ps_configuration and ps_shop_url.

 

The ps_configuation file varies as not everyone installs the same modules or in the same order.

 

I just click browse at the top of the ps_configuration table and scroll through the pages and look for anything related to shop domain, shop email and so on.

Link to comment
Share on other sites

The ps_configuation file varies as not everyone installs the same modules or in the same order.

Aha! here we got some interesting point to carry about.

This is very useful information for the newbies like myself, thanks tdr170!

 

I wonder, editing database may be the main reason why there is so many "white" pages beginners experience after the shop transfer?

Link to comment
Share on other sites

Well I am transferred and up and running now thanks to the help here! And so here is what I did.

 

1) I wanted to keep the original PS1.5 in the sub folder as a backup, rather than move the shop out to the root. So after putting the shop into maintenance mode, I copied the entire shop directory down to my computer and then uploaded it to the root of the domain.

 

2) I then changed the name of the original shop sub directory, to confirm I was no longer accessing the original shop.

 

3) Next I renamed the existing .htaccess file in the root to prevent it being overwritten. (I have lots of directories in the root of the site which I wish to retain and continue to use and there was already a file of that name there, along with some others including css which had to be changed to prevent their being overwritten by the PS versions) This meant that PS could generate a new clean .htaccess file when doing step 4 below

 

4) As the database remains the same, I then went into myPHPAdmin and changed the ps_shop_url to be the root of the domain.

 

5) Doing the above allowed me to log in to the new admin in the root.

 

4) I then went to the Preferences and saved the SEO & urls as indicated in the previous post. And then, via ftp, confirmed there was a new .htaccess file in the root of the domain.

 

6) I then had to amend the paths in my top menu and CMS pages as required; shortening them to remove the original sub directory.

 

7) I did a few force compiles along the way.

 

Finally having checked things in the BO, I made the store live again. And everything seems to be ok at the moment. So hope this additional info helps others confronted with this site move.

 

Peter

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

When I changed ps_shop_url to the root I lost access to the BO and the site became a mess, it was just color and links. I added my domain to the SSL URL and the BO came back.

 

Now I can't save changes in the BO, I can edit modules but nothing else works. The Front Office looks OK now, the cart is not getting past the terms and conditions?

 

Any advice? Would my SSL effect anything?

Edited by Sages Outdoors (see edit history)
Link to comment
Share on other sites

  • 5 months later...

I have succefully move from web to local host a new frech presta 1.5.4.1, once I have moved it , I can go to BO and FO, also I can add a module and so one.

But with my main web I cant, I dont know why I have done the same, I have

 

0.Unactive all the modules that are not native

1.Modify the table ps_configuration in table PS_SHOP_DOMAIN and in PS_SHOP_DOMAIN_SSL to localhost.

2.Modify the table ps_shop_url in domain to localhost, in domain_ssl to localhost, in physical_uri to /notaria-52/notaria-52/

3.Erase the files in cache\smarty\compile and in cache\smarty\cache everything with out the index php .

4.Rebuilt the htaccess by enable and disable the multistore

 

The good part is that I cant enter to the BO, but by the time that I click in modules I get white page with [PrestaShop] Fatal error in module Cart:

Class 'Cart' not found

 

That also happends if I try to go to products.

 

In the front office I just get white.

 

HELP!!!! please.! Its driving me crazy!..

 

I am willing to pay, I need this solve asap

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...