modmore / Gitify

Command line toolkit to make managing a MODX site in git a lot easier.
MIT License
122 stars 55 forks source link

Multiple Contexts - resources not coming over. #178

Closed torqpad closed 8 years ago

torqpad commented 8 years ago

Overview: Hey guys, man this project is exciting. Thank you for all your work on this. I am using modx 2.4.2pl and am having a heck of a time going from our dev server to our production server with context html resources disappearing in the production server after a Gitify build --force.

Details: I have a git repository setup in the root folder of our dev environment. I do a Gitify extract, git add . then commit that to the git repository on my private github account.

When I pull in the clone of the git repository, git reset --hard, and Gitify build --force, it seems to work great. When I go into the newly built modx manager, html resources are not as they appear in the dev manager and some have disappeared that are in the dev server. This happens every time on different installs . The Gitify build is being done over an existing modx install. Can you provide any insight as to what I might be doing wrong, I have spent over 12 hours today, going back and forth on this one issue with no resolution.

The end goal is to use the dev server as a staging environment for the live server. I am wanting to use Gitify to transfer the modx changes over git to update the live server.

Mark-H commented 8 years ago

Glad you like Gitify :)

Force is a bit of a nuclear option that I wouldn't recommend using all of the time. In normal operation, the regular build will do just fine.

When you use verbose mode (instead of force), it will show you exactly what's happening to the resources you're missing. Perhaps it doesn't recognise them because they aren't in the file system so it removes them as orphans. Another potential issue could be that in your gitify file, the data resources depend on (contexts, TVs etc) are added below the content item. In that case data might be getting lost because of that.

hugopeek commented 8 years ago

Hi 360itsolution,

Yeah I had a hard time setting it up too in the beginning, but don't give up, it will be worth it in the end!

Ah Mark beat me to it, of course.. :D To add to that, I have had issues with resources having the same alias disappearing on build too, but they were always in the same context I think. But are your aliases all unique? And can you post your .gitify file here?

torqpad commented 8 years ago

Thats a great point. On first build there were aliases being used that were identical, so I went back and renamed the aliaes so that there were no duplicates, then went back, and extracted, and put in the repository with no luck of the disappearing html resources showing up on the live server. Unsure of where to turn. Would it matter I did not install modx with Gitify?

data_directory: _data/ backup_directory: _backup/ data: contexts: class: modContext primary: key context_settings: class: modContextSetting primary:

hugopeek commented 8 years ago

Can you see if the resources are there in the live database? Maybe they are, but didn't receive the correct context key..

Not installing MODX through Gitify shouldn't be a problem.. But like Mark said: it's probably wise to move the content further down, to after plugin_events.

torqpad commented 8 years ago

Yes, if I search for the title of the resource they seem to be there, but not listed in the manager, almost like a ghost...

I will move content down further and try to build

torqpad commented 8 years ago

When I use Gitify extract -vvv I see where the error is coming from when trying to extract, but I am not sure how to fix it...

There is an error in each context in relation to an old uninstalled package called Articles. The error is

[2016-02-23 14:46:15](ERROR @ /home/brian/Gitify/Gitify) Could not load class: ArticlesContainer from mysql.articlescontainer. This is why it seems there are missing resources, because it stops on that error in the current context and continues to the next context.

I have taken all resourses out of the groups in manager and sorted by alias to find the point where that error exists, but I find no mention of any "Articles (old installed package)"

Do you guys have any insight on possibly broken packages in the sql in relation to trying to extract the content? I have uninstalled and removed the package and still get the error.

torqpad commented 8 years ago

Gitify extract -vvv saved me! I just installed the old broken package from the modx manager and boom! It committed everything to the repository. Verbose allowed me to see what was broken in modx and where the error was coming from. Great project here guys!

Mark-H commented 8 years ago

Glad you got it sorted!