Page 1 of 2

Migr J1.5 tp 3.0

Posted: 11 Apr 2013, 08:35
by Pandrag
hello at all,

sorry for my bad english.

i want to migrate the guestbook from j1.5 to 3.0. the tutorial on https://www.phoca.cz/documents/50-phoca/ ... -joomla-25 seems not work for 3.0. is there another way?

thanks for an answer

Re: Migr J1.5 tp 3.0

Posted: 16 Apr 2013, 00:28
by Jan
Hi, I will write the guide after alle the extensions will be overwritten, for now Joomla! 3 is not LTS stable and all the extensions are in development version, so it will change.

Jan

Re: Migr J1.5 tp 3.0

Posted: 27 Apr 2013, 13:13
by jacopp
same problem

after import jos_phocaguestbook_books and jos_phocaguestbook_items

Polish phpMyAdmin

Code: Select all

Błąd
zapytanie SQL:

UPDATE  `jos_phocaguestbook_books` SET  `language` =  '*'

MySQL zwrócił komunikat: 

#1054 - Nieznana kolumna 'language' w  field list 
any solutions ? please help

Re: Migr J1.5 tp 3.0

Posted: 30 Apr 2013, 16:24
by ruppsucks
I am very interested in this as well, thanks!

Re: Migr J1.5 tp 3.0

Posted: 04 May 2013, 22:46
by Jan
Hi, as I wrote, Phoca Guestbook for Joomla! 3 is not stable yet, first I need to make it stable then I will take a look at the migration guide.

Jan

Re: Migr J1.5 tp 3.0

Posted: 06 May 2013, 23:51
by ruppsucks
Hi Jan,

any timeframe you can give us for this?

Thanks!

Re: Migr J1.5 tp 3.0

Posted: 07 May 2013, 21:09
by Jan
Hi, see similar posts, unfortunatelly there are so many factors which can influence it, so I cannot say :-(

Jan

Re: Migr J1.5 tp 3.0

Posted: 15 May 2013, 23:11
by info
ATTENTION:
If you don't know sql and php please wait for a script!


The following steps are untested, but should work for update one Guestbook (one category) from 2.5 to 3.x!
(Perhaps also 1.5)

First install the new guesbook
- Install guestbook v3 on joomla 3
- create a new guestbook (category has changed) in admin->components->phocaguestbook->guestbooks->new

Use ie phpmyadmin:
- go to joomla core table "joomla3prefix_category" and search the ID of your created guestbook (extension com_phocaguestbook, should be last one)
- copy items via sql (replace YourCategoryID and prefixes)

Code: Select all

INSERT `joomla3prefix_phocaguestbook_items` ( id, catid, parent_id, lft, level, username, userid, email, homesite, ip, title, alias, content, date, published, checked_out,	checked_out_time, language)
SELECT  id+1 AS id, YourCategoryID AS catid, 1 AS parent_id, ordering AS lft, 1 AS level, username, userid, email, homesite, ip, title, alias, content, date, published, checked_out,	checked_out_time, language
FROM `joomla2prefix_phocaguestbook_items`
Remark: Do not delete the root entry in joomla3prefix_phocaguestbook_items!

The post are available now but are not "valid":
- you have to rebuild the structure (update ordering to the new format). Therefore you can use a little trick:
open the file administrator/components/com_phocaguestbook/models/phocaguestbook.php and search the function:
public function saveorder(..) and change:

Code: Select all

public function saveorder($idArray = null, $lft_array = null)
	{
		//ADD START
		$table = $this->getTable();
		$table->rebuild();  //THIS rebuild the index!
		//ADD END

		/* FOLLOWING IS UNCHANGED
		// Get an instance of the table object.
		$table = $this->getTable();

		if (!$table->saveorder($idArray, $lft_array))
		{
			$this->setError($table->getError());
			return false;
		}

		// Clear the cache
		//$this->cleanCache();
		*/

		return true;
	}
- Go to admin->component->phocaguestbook->items and reorder (drag an drop) anything.
- undo the changes of the file

I hope you can do something with this code. If not wait for the script ;)

Re: Migr J1.5 tp 3.0

Posted: 24 May 2013, 23:47
by Jan
Hi, thank you for the guide.

Jan

Re: Migr J1.5 tp 3.0

Posted: 18 Oct 2013, 16:07
by ToXiQ
Old topic but probably something changed

One thing is not clear to me:
go to joomla core table "joomla3prefix_category" and search the ID of your created guestbook (extension com_phocaguestbook, should be last one)
Is this the extention_id from extension com_phocaguestbook or when you create the new guestbook the guestbook ID which can be seen in the guestbooks overview?

I used last one and took the ID from the guestbook catagory manager.

I made a backup and cpied the table so I can go back easy and did do the following:

Code: Select all

INSERT `YOUR_PREFIX_phocaguestbook_items-org` ( id, catid, parent_id, lft, level, username, userid, email, homesite, ip, title, content, date, published, checked_out,   checked_out_time)
SELECT  id+1 AS id, YOURCATAGORY_ID AS catid, 1 AS parent_id, ordering AS lft, 1 AS level, username, userid, email, homesite, ip, title, content, date, published, checked_out,   checked_out_time
FROM `jos_phocaguestbook_items`
As you an see I removed the alias and the language field because I got errors on it.

Then I updated the language field:

UPDATE `YOUR_PREFIX_phocaguestbook_items-org` SET `language` = '*';

After these changes I saw my old items in the new guestbook and all items posts are marked green.

BUT I am getting an error when adding a new guestbook posting:

Code: Select all

1062 - Duplicate entry '1' for key 'PRIMARY' SQL=INSERT INTO `q7i16_phocaguestbook_items` (`id`, `catid`, `parent_id`, `lft`, `rgt`, `level`, `path`, `username`, `userid`, `email`, `homesite`, `ip`, `title`, `alias`, `content`, `date`, `published`, `checked_out`, `checked_out_time`, `params`, `language`) VALUES (1, 0, 0, 0, 1, 0, '', 'ROOT', 0, '', '', '', 'root', 'root', '', '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00', '', '*');
After this I tryed to rebuild the postings with the above mentioned seps. I have changes some of them but I am still getting the Duplicate entry 1 fault.

Who can give some help? I am not afraid to test things but I don't know anything about PHP or mysql :o I use my common sense to do things with some help from google :wink: . So DON'T use my steps if you are a not knowing what you are doing and if you DO do it on your own risk. Make ALWAYS backups before you change anything.

regards Walter

I found out that two fields must be rebuild lft and and rgt. lft must starts with 1 and then for all other entries 1 higher and same for the rgt field which only has to start 1 number higher than lft

so lft = 1 same record rgt = 2.

then as last the first row rgt wich is from root must be a number +1 from the highest count from that rft record

now finding a slolutiun to replace that tft and rgt field