Updating page custom fields from development site to the live site

Basile Laderchi asked on October 13, 2016 12:53

I have two Kentico 9 installations:
one is the development site and the other is the live site (not accessible from the development site).

I have created an MVC site. I am trying to update the live site with the changes made in the development site and we are looking for a way other than backing up/restoring the database (will have users signing up in the live site and can't tell them to be re-registering every time I make a little change).

Scenario is a follows: I have a page type "Index" and created the page "Index" based on this type.
Among other things this "page type" has a "title" field that is required.

When I make a change in the development environment it has to somehow (not necessarily automated) update the live site.
I have tried using the "export site" and then "import site", but it didn't update then changed fields.
I have already enabled the "log content/data/object changes" under the staging settings. In the CMS_EventLog tables I can see the UPDATEDOC EventCode.
I have also tried following this document https://docs.kentico.com/display/K9/Example+-+Importing+a+culture+version+of+a+page+using+the+Kentico+Import+Toolkit leaving out of the query the DocumentCulture filter, not erasing the NodeAlias field (I didn't want to create new culture version of the page, just update the existing ones) and as parent id I set the id of the site's /, but it responds with "An error occurred on import: Path cannot be empty" and after ignoring the error with "Cannot insert duplicate key row in object 'dbo.View_CMS_Tree_Joined' with unique index".

Thank you in advance,
Basile Laderchi

Recent Answers


Jan Hermann answered on October 13, 2016 13:35

Import/Export should update changes if you confirm it (check box next to your page type during importing process).

Content staging requires the development server to be able to access the live site.

Import toolkit can also update your page type, but you need to import page type first and then pages of that type.

Maybe you could also export your users from your live site and import them again after you restore the database.

0 votesVote for this answer Mark as a Correct answer

Basile Laderchi answered on October 13, 2016 14:04

I rechecked again the Import/Export procedure.
Inside the exported zip file in the cms_document.xml.export file the change of the title field exists.
Selected the radio "Import objects into an existing site" and made sure that all the "Page types" were selected even if they had a warning mark next to them.
After the import has finished I checked the site and the database and still the "title" field had the old value.

As to the Import toolkit how would I import the page types first (which already exist) and then the pages.

Exporting the users and then importing them again is not a viable option because there are many other things like files uploaded by the users in the media library and in the database and other data kept in database tables

Basile

0 votesVote for this answer Mark as a Correct answer

Jan Hermann answered on October 13, 2016 14:49

That's interesting. What version of Kentico do you use (including the hotfix)?

Anyway, staging would solve this, it's a shame those servers can "see" each other.

0 votesVote for this answer Mark as a Correct answer

Basile Laderchi answered on October 13, 2016 15:04

If the version (including hotfix) is the one reported on the toolbar after you click the ? then it is v9.0.

0 votesVote for this answer Mark as a Correct answer

Jan Hermann answered on October 14, 2016 10:26

I did some tests on newer version of Kentico (9.0.39) and when I updated a field in my page type and then reimport the site to update previously imported site I got the field updated correctly. I have also searched for bugs related to this from version 9.0, but I've found none. What is the change on your field?

0 votesVote for this answer Mark as a Correct answer

Basile Laderchi answered on October 14, 2016 12:25

In the page type I have defined a field with name "title" and data type "text" that is required.
Then I go to the already defined page of that type, open the view in "compare mode" so that I can see both translations of the page fields.
In the english culture field I change the contents. I do this in the greek culture field and click "save" on both cultures. In the log I get two UPDATEDOC lines.
Then I export and import the site in a different installation (backed up and restored just before the field change). Only differences between the two instances are the different db they get the data from and the "presentation url" of each site.

Don't know if that's important, but both sites run use a localhost not expiring license.

0 votesVote for this answer Mark as a Correct answer

Basile Laderchi answered on October 18, 2016 11:22

Do you suggest I should upgrade to the latest Kentico hotfix?

Just in case I need to backup the Kentico web site and it's database to be able to revert to the old version?
Do I need to backup anything else?

0 votesVote for this answer Mark as a Correct answer

Jan Hermann answered on October 18, 2016 15:47

First of all, changing data in the compare mode for not selected culture is not supported (this is just by the way).

When you make a change on your page type and then you update pages of that page type, you need to include those page types to your site export as well to have then updated on your target server.

For backuping Kentico you need just a copy of your project folder and a backup of your database.

0 votesVote for this answer Mark as a Correct answer

Basile Laderchi answered on October 18, 2016 16:32

Under the site I am interested in I have 2 cultures: "English - United States" and "Greek - Greece".
When I go to the pages I select a page (in compare mode) and right left half has my page in the English culture and on the left half I select the Greek culture.
I had changed only a specific field's contents in both cultures, hadn't added any fields (but I now need that option too) or changed the page type in any way.

One of the tests done was to restore everything on the target site (I clicked on every possible option and enabled if even if it had a warning) and still the target site didn't get updated.

Now my task is even harder. I now have new page types, fields removed from already existing page types and field's contents changed.

0 votesVote for this answer Mark as a Correct answer

Basile Laderchi answered on October 19, 2016 11:08

I have upgraded to v9.0.44 and I still have the same problem.
After importing the exported site the new page types have been created, the changes on already existing page types have been applied, but the new and updated pages have not been created or updated.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.