ponzu-cms / ponzu

Headless CMS with automatic JSON API. Featuring auto-HTTPS from Let's Encrypt, HTTP/2 Server Push, and flexible server framework written in Go.
https://docs.ponzu-cms.org
BSD 3-Clause "New" or "Revised" License
5.7k stars 383 forks source link

backup ponzu folder can not restore in local #287

Closed eiffelqiu closed 5 years ago

eiffelqiu commented 5 years ago

I have a ponzu site running on a linux server, I copy the whole folder and run in my mac book for development, when i login admin, the content does not show, but all others functions remains. the analytics.db seems to work, uploads can be seen from admin UI, but the Content Type all lost.

Then i delete "system.db", "analytics.db " and "uploads" , use backup script to backup these files in local ponzu folder, still does not work.

can any one help me with this, how can i restore server env in local machine.

logicalphase commented 5 years ago

If system.db is in the backup set, than it might be permissions issue. Try building it ponzu build and see if that restores your content on your dev side.

eiffelqiu commented 5 years ago

928

I remove the ponzu-server and rebuild it with "ponzu build", i change system.db to 777 , still no luck

content type does not show on the left side of admin

logicalphase commented 5 years ago

Strange. Try installing a bolt DB viewer or editor like https://github.com/nisboo/BoltGUI/blob/master/README.md and verify if the data exists.

eiffelqiu commented 5 years ago

Strange. Try installing a bolt DB viewer or editor like https://github.com/nisboo/BoltGUI/blob/master/README.md and verify if the data exists.

Interesting, I installed bolt DB viewer, it can show system.db content files, it has all the records,but I still can NOT see Conetent Type using "ponzu run",

when i access "http://localhost:8080/admin/contents?type=Song" directly

it shows

"400 Error: Bad Request Sorry, the request was unable to be completed."

929

logicalphase commented 5 years ago

Hmm. Assuming the versions of Ponzu are the same, although I doubt that matters much, I'd try opening the admin in incognito tab in Chrome, or private tab in others, just to make sure you're not running into a browser cache issue. I'm not sure, but it won't hurt.

eiffelqiu commented 5 years ago

I also though it might be the cache problem, so i clear the chrome browser's cache, still not work, then i run in "incognito“ mode, still not work for me.

logicalphase commented 5 years ago

I'm out of ideas. If it's not displaying the content type, and there are no console errors other than the 404, it makes me think there's either a file path issue, or some corruption in the copied files. If you didn't already, run a actual backup and download and restore it. Maybe @nilslice or someone else can help.

eiffelqiu commented 5 years ago

I'm out of ideas. If it's not displaying the content type, and there are no console errors other than the 404, it makes me think there's either a file path issue, or some corruption in the copied files. If you didn't already, run a actual backup and download and restore it. Maybe @nilslice or someone else can help.

I first copy folder directly from the server, it does not work, so i though the system.db might have some sync issue, so i remove 2 db files and upload folder, and using backup script to replaces these files, but still not work.

nilslice commented 5 years ago

@eiffelqiu - would you be able to share the content file that produces the Song content type that you're trying to load in the CMS admin?

Just to be sure, you are also running the same ponzu-server binary from the remote instance, or one that was built with the same source code & content files (e.g. content/song.go)? The database alone cannot populate the UI, since the content types must be known at compile-time in order for content to be managed by the CMS. You may know this already, but it's worth mentioning.

@hyperpress - many thanks for your suggestions!

eiffelqiu commented 5 years ago

song.go.zip

@eiffelqiu - would you be able to share the content file that produces the Song content type that you're trying to load in the CMS admin?

Just to be sure, you are also running the same ponzu-server binary from the remote instance, or one that was built with the same source code & content files (e.g. content/song.go)? The database alone cannot populate the UI, since the content types must be known at compile-time in order for content to be managed by the CMS. You may know this already, but it's worth mentioning.

@hyperpress - many thanks for your suggestions!

I rebuild ponzu-server on my macbook laptop(server run on ubuntu), not work, i attach my Song.go file

eiffelqiu commented 5 years ago

Hi all, I finally solve the problem.

It seems that i should copy my ponzu website folder(from server) into the GOPATH, it works now, but when i run ponzu inside an temporary folder, it fails.

Thanks every one.

nilslice commented 5 years ago

Hi all, I finally solve the problem.

Great! Thanks for updating w/ the solution 👍

It seems that i should copy my ponzu website folder(from server) into the GOPATH, it works now, but when i run ponzu inside an temporary folder, it fails.

Ah, yes. There is a bit of work that needs to be done to support Go Modules.