Jump to content

Migration from Staging Environment


quickjeff
 Share

Recommended Posts

Hi Guys, 

I wanted to post this thread to get some insight as to how others are migrating from a staging directory inside a live server to the actual root directory.

I typically develop a project locally using Mamp and then move into a staging environment on a staging server . There are some cases the project requires to move the site into a directory inside a live site to make deployment of the new project move faster.

When I move a project into a directory on the live server of domain.com/test/ I run into an issue of content links.

What I mean is that I look at the source code in the CKEDITOR for a field and the link will display:

 domain.com/test/whatever-the-link-is/ 

or 

domain.com/test/assets/file.pdf

or

domain.com/test/assets/image.jpg 

 

The issue is, when I move to a live site, I have to go back and change tons of links from:

domain.com/test/whatever-the-link-is/

to 

domain.com/whatever-the-link-is/  

 

How are you guys making the link changes across the entire site at once?

Are you using SQL Commands? Something in ProcessWire?  Any suggestions will help eliminate the manual process. :-)

Link to comment
Share on other sites

At least for links to pages, you can enable the builtin link abstraction feature that came with PW 3.0.6. I haven't used it myself (wrote my own link abstraction shortly before 3.0.6 came out and mine ties into other modules/workflows I use), but from what I saw in the code, it should deal with any path changes on its own. You're left to handle images yourself though (I think).

  • Like 1
Link to comment
Share on other sites

2 hours ago, quickjeff said:

What I mean is that I look at the source code in the CKEDITOR for a field and the link will display:

 domain.com/test/whatever-the-link-is/ 

For me, all internal links made in a CKEditor field are relative links, and these wouldn't need to be updated if the site was moved to a subdirectory. Not sure why you would be getting absolute links in yours.

There is a config setting for ProcessPageEditLink to set the URL type:

page-link.png

Strangely, mine is set to "Absolute", but maybe this means "absolute relative to the site root"?

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
 Share

×
×
  • Create New...