Some advice for site migration

Hello, I am new to the world of Ghost, Node.js and Nginx so please pardon the ignorance. I have a website that I am migrating to Ghost but it is a large site, a magazine that has about 1400 posts. The only way to reliably move the posts is one at a time so my plan was to keep the old site live with a different URL and link to the old site when people want to see older posts. My problem is, the old site used absolute paths for almost all images so when I switched domain names, all those images went offline. My plan was to simply move all the images from the old site to the new site keeping the folder structure the same but when I try that, the folders I move won’t route in Nginx.

So I have the old site as http://tilife.org/backissues
The new site is https://thousandislandslife.com

All images on the old site are in a folder structure tilife.com/portals/

I was hoping to make a folder in the new site thousandislandslife.com/portals but when I do, I just get a 404 error for anything I put in there.

I tried to create a virtual directory in the Nginx server block, but I cannot get it to work either.

I then thought maybe I could use jquery or javascript on the old site to replace the image source absolute path with a relative path or replace the domain name in the path.

I am sure there is a simple answer, but I just lack the expertise at this time. I have been trying awful hard to find a solution on my own, any advice would be well received.

Have you seen/tried these resources?

They might have some clues/hints to help you on the way with this migration.

You can also do this with nginx redirects, some help here:

These are just simple pointers for the main issues you describe, but we would need more detailed information in order to better help with your specific case.

The old site is DotNetNuke and the way articles were written, the only way to move the site is one article at a time. I expect it to take a year by doing a few a day so the old site needs to keep working and it does work, except most images don’t load due to the HTML using absolute urls. So if you look at this page, you will see the images don’t load because of the HTML. For example, an image tag is written this way:

<img title="Jean Papke Singer Island" style="margin: 14px 16px 17px 0px; float: left; display: inline; background-image: none;" alt="Jean Papke Singer Island" src="http://www.thousandislandslife.com/Portals/_default/Users/247/47/247/Jean_Papke_Singer_Island_thumb.jpg" width="431" height="248" border="0" align="left">

The above sample is an example why I didn’t bother trying to convert the contents to json and import. I did however make a json file for the 350 authors and import them. But looking at the src of that image tag, you can see that the image is physically located on the server in the folder /Portals/_default/Users/247/47/247/.

My idea to solve my issue, is to copy that entire portals folder from the old server and move it to the new server so that http://www.thousandislandslife.com/Portals/_default/Users/247/47/247/Jean_Papke_Singer_Island_thumb.jpg (the image src) once again works. So the old site would be perfect once the folder is moved. But if I make a folder called portals on my new site, it will not route. So I was thinking I could put this folder outside the native Ghost site structure and set up an alias or virtual directory called /portals that points to where I put the folders.

The advantage of doing it this way is that when we are ready, we take the old site down and not lose the images.

Once I get this solved, I am going to make a redirects file for SEO purposes. This is a real simple solution to the problem, I just don’t know how to make a working alias in nginx.

My other idea is to use javascript replace on the old site to remove the http://www.thousandislandslife.com/ from every img src. But my other idea has more advantages.

I went with the jquery option on the old site

  <script type="text/javascript">
       
    $(document).ready(function() {
        var strNewString = $('div.articleEntry').html().replace(/www.thousandislandslife.com/g, "tilife.org");
        $('div.articleEntry').html(strNewString);
    });

    
</script>

We’re working on overhauling our migration docs and adding tooling. The first pass of this is complete and can be seen here:

We will be adding more tooling soon for handling pulling down images into a Zip file that the Ghost importer can support.

In the meantime, there’s now much more info about how to create a working Ghost JSON file, and tips for converting HTML to mobiledoc.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.