• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

How to change installation path of Wordpress application?

Umar2003

New Pleskian
Hello,
I have installed the Wordpress application. The wordpress url is "server.com/wordpress", but I want to change it to something like "server.com/myblog".
In Plesk, the installation path cannot be changed (at least, it is not under "Change Settings").
Changing the Wordpress installation itself is not that difficult (renaming the folder in httpdocs and changing the siteurl and home parameter in the database), however, in Plesk still the old installation path is shown, and the Plesk interface to Wordpress obviously does not work any more.

How can I change the Wordpress installation path in Plesk?
Thx, Umar

Version Parallels Plesk v12.0.18_build1200140606.15 os_Ubuntu 12.04
OS Ubuntu 12.04.5 LTS
 
Since I just finished wrestling with this myself, and this forum came up in my Google searches, I'm sharing my solution.

Note, this is on a Linux server.

As an admin user, at a terminal:

plesk db dump > PSA.sql
This creates a SQL dump, essentially a backup of your psa database.

Edit that (or a copy of it) looking for instances of "/wordpress" and "'wordpress'" in the following tables:

  • apsResourcesParameters
  • WordpressInstanceProperties
  • WordpressInstances
Remove the relevant parts, for instance:

(145,71,'urlPrefix','wordpress') becomes (145,71,'urlPrefix','')

(14,16,'/httpdocs/wordpress',0,14) becomes (14,16,'/httpdocs',0,14)
Pay special attention to string lengths in variables that look like this:
... s:19:\"/httpdocs/wordpress\" ...
so that your updated string would be:
... s:9:\"/httpdocs\" ...


Once your SQL file is duly scrubbed, import it back into the psa database thus:

plesk db < PSA.sql

To be satisfied that your update has worked, show one of the updated tables:

plesk db show apsResourcesParameters
The lines with "urlPrefix" should no longer contain "wordpress".


Log into Plesk, and go to Server Management -> Wordpress.

Click on a broken installation, to edit it. Click the "Refresh" button at the top of that page. The page should now show a proper Wordpress installation in the root instead of a sub-folder.

Share and enjoy!
 
Back
Top