Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Migrating 2.4 data to new site built with 3.2


Go to End


13 Posts   1862 Views

Avatar
martimiz

Forum Moderator, 1391 Posts

4 July 2016 at 9:17pm

Changing _ss_environment.php should change the database. The website in live mode would still display the default content from it until you publish a page - the important thing: what kind of content do you see in the CMS :) ?

Unless (just thinking out loud)...

You're not using static publishing, or some external cache?
There's no reference to the old db in _config.php?

Avatar
Vlad Belfort

Community Member, 55 Posts

4 July 2016 at 10:59pm

In the CMS I see all the content from SiteTree...
What it was I didn't move over SiteConfig so it wasn't using any themes; I just had to set the theme to the one I was using prior to switching databases and it works now :)

Avatar
Vlad Belfort

Community Member, 55 Posts

4 July 2016 at 11:55pm

Edited: 05/07/2016 12:09am

For publishing pages when the multi-selection doesn't work, this helps:

Publishing via URL

It seems to be working fine except when it hits an error, currently I'm getting:
Validation error: Infinite loop found within the "Content" hierarchy. Please change the parent to resolve this

It doesn't give me much to go on and I can't find the page it's talking about, how would I resolve this?

Avatar
martimiz

Forum Moderator, 1391 Posts

5 July 2016 at 1:15am

Ah - I never knew about that URL publishing method - totally missed it, thanks...

I've had to solve this once for a website built and maintained by someone else - basically it means that a page's ParentID is either equal to it's own ID, or it points to a page that is in fact its descendant... I was able to pinpoint the culprit pages because suddenly the client couldn't find them in the CMS anymore, so they knew which one it was...

You could try echoing the current page's ID in the publishall() function, to see on which page it errors

cms/code/controllers/CMSMain.php ~#1291:

			while($pages) {
				foreach($pages as $page) {
					if($page && !$page->canPublish()) return Security::permissionFailure($this);

					echo "$page->ID - ";       <===== THIS ONE

					$page->doPublish();

Avatar
Vlad Belfort

Community Member, 55 Posts

5 July 2016 at 2:17am

Ah sweet!

I got some pages which had the same ID and ParentID by doing an SQL query

select * from SiteTree where ID = ParentID;

Which worked nicely to find the pages that referenced themselves, I reset them to top-level because I have no idea where they need to go. It seems to be working so far but I did dread what'd happen if it did an actual loop with more than 1 page, like you described above, I tried changing the Validator code in Hierarchy.php as that's where that message came from but nothing changed.

Will try editing the CMSMain file if I get that error again (It takes so long when running this cmd, it also seems to revert any changes if all pages haven't been successful which is understandable but a little lame)

Go to Top