Migr J1.5 tp 3.0

Phoca Guestbook - creating guestbooks in Joomla! CMS
Pandrag
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 11 Apr 2013, 08:33

Migr J1.5 tp 3.0

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Migr J1.5 tp 3.0

Post 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
If you find Phoca extensions useful, please support the project
jacopp
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 27 Apr 2013, 13:10

Re: Migr J1.5 tp 3.0

Post 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
ruppsucks
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 15 Sep 2011, 10:46

Re: Migr J1.5 tp 3.0

Post by ruppsucks »

I am very interested in this as well, thanks!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Migr J1.5 tp 3.0

Post 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
If you find Phoca extensions useful, please support the project
ruppsucks
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 15 Sep 2011, 10:46

Re: Migr J1.5 tp 3.0

Post by ruppsucks »

Hi Jan,

any timeframe you can give us for this?

Thanks!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Migr J1.5 tp 3.0

Post by Jan »

Hi, see similar posts, unfortunatelly there are so many factors which can influence it, so I cannot say :-(

Jan
If you find Phoca extensions useful, please support the project
info
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 03 Nov 2012, 11:52

Re: Migr J1.5 tp 3.0

Post 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 ;)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Migr J1.5 tp 3.0

Post by Jan »

Hi, thank you for the guide.

Jan
If you find Phoca extensions useful, please support the project
ToXiQ
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 14 Oct 2013, 19:03

Re: Migr J1.5 tp 3.0

Post 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
Post Reply