I’ve got Ghost setup, but want to import around 100mb of content.
Firstly I was getting an error saying that I couldn’t upload files that big. I edited my nginx config so that I could upload larger files
Then I was getting 504 timeouts, so I increased the timeout time with nginx
Now it sits in the importing state for a few minutes, then throws a 502 and “Uncaught Error: Request was rejected due to server error”.
Are you saying your JASON file is 100MB? I doubt that would be the case, because that would be one huge site. But you should be able to use SFTP to move your Content folder to the new location. What I would do is zip it first, move the zip file to the new server and unzip it in the proper spot. Import the JASON file from the Ghost editor in the Labs section and it should work.
Yes the JSON file is 100mb, it is a huge site. I am using the import tool in the Labs section, it’s there that after 2 or 3 minutes after selecting the file and importing it that I’m getting the 502
Can you try importing via the Ghost-CLI? I don’t know that it will work, but it’s worth a shot:
ghost import {file}
Another thing to note is that the import shouldn’t stop running even if you run into a gateway timeout. I suggest taking a look at your Ghost logs to see if something’s failing
Was this JSON file generated by Ghost Admin’s export function? Is there any chance there’s an error in the JSON file? As @vikaspotluri123 suggested check your Ghost logs and let us know if you find anything.
I already increased my timeout on nginx to 10 minutes.
This issue is solved now. I had to split up the JSON file. It’s a bit weird that it can’t handle a 100mb file, but basically I split the json posts into 4 separate files (I also had to upload the other properties with it, otherwise the posts wouldn’t have
authors or tags).
Ah glad you were able to find a solution. I wonder what the practical limit is on the JSON file size. I’ve been trying to find a way to automatically back up the JSON files along with my content dir and db dumps but after your experience here I wonder if it’s even worth it to try and back up the JSON export.
I just did it manually. Vscode couldn’t handle the large amount of JSON so I had to use something called ultraedit which is very lightweight (haven’t opened it since though).
It has built in formatting tools too so it’s easier to see what you’re dong.
I ended up using sublime to edit manually. For mine I creased a series of files with the top and tail containing everything except for the post array. Then into each file I manually pasted a section of the posts. Appears to all have worked OK.