Добавить в FacebookДобавить в Google BookmarksДобавить в TwitterДобавить в OdnoklassnikiДобавить в Vkcom

How to move site from joomla 2.5 to joomla 3

Literally a few days ago I had to move the site from the joomla 2.5.x engine to joomla 3.x. On the official site of joomla (https://docs.joomla.org) it was recommended to migrate , removing old, incompatible with joomla 3.x, versions of third-party components and packages. I have already done this kind of migration several times before and it was successful. However, the migration of this site occurred with errors, after which either the site did not start at all, or the admin work partially. In this regard, I decided to transfer the content and settings of the old site to a freshly installed joomla 3.4.1.

To do this, I created a test subdomain on the hosting and installed the latest version of joomla. When installing joomla 3.4.1, I filled out the name, administrator email, database prefix and other parameters are identical to the old site. It is very important when filling out the database parameters to create the same table prefix as on the old site. For example, in the old database, the prefix was psdfe_. Accordingly, the new database should also have the psdfe_ prefix. After installation, I first of all transferred the settings files .htaccess, configuration.php, robots.txt  and files yandex и google webmaster, thereby transferring the SEF settings and others. Next, I installed a new engine, fresh, compatible with joomla 3.x components, plug-ins, modules. And now after that, I started to transfer the content. For this, I created an intermediate database. Opened the phpmyadmin database of the old site, selected all the tables and clicked the export. So I exported the database to the .sql file on my computer. After that, I opened the newly created intermediate database and imported the old database there. This is done so. In phpmyadmin, by opening the intermediate database, you become the name of the intermediate database and click the import button. Select the .sql  old database file and click the OK button. So you get a complete copy of the old site's database, from which you can safely manipulate. Let's start the most interesting. In the intermediate database (a copy of the old site's database), we are interested in the psdfe_content (you will have another prefix), psdfe_menu, psdfe_menu_types и psdfe_categories. In the future, you must be very careful. Just in case, create a backup copy of the database of the newly installed joomla 3.x. So you have both an intermediate database and a new site open in phpmyadmin. Select the psdfe_content table and click the "structure" link. After that, compare the structure of the tables in both databases. When comparing, I noticed that in the intermediate database table (a copy of the old site's database) there are columns title_alias, sectionid, mask, parentid, which are not in the same table of the database of the new site. That is, they are superfluous. I deleted them from the intermediate database (a copy of the old site's database). If you do not do this, mysql will not be able to perform the import, due to query errors when you try to insert non-existent columns into the new database's database table.

So we brought the tables in the intermediate database (a copy of the old database database) to a structure identical to the database structure of the new site's database. Now we open the psdfe_content table of the intermediate database (a copy of the old site's database) and tick all the tables inside it.

And click on the export. We get, for example, the file content.sql (I called it so). The  psdfe_content tables contain all the articles of the old site. After that, open the database of the new site, select the table with the same name psdfe_content and click "clear".

This is done to ensure that the id of the old tables does not coincide with the id of the new tables when importing. You simply clean the database of the new site from any articles. All is ready. Reopen the table (it is already empty) psdfe_content, click the import, select the file content.sql and move all the articles of the old site to the new one. The same is repeated with the rest of the tables that contain menus, categories, etc. The scheme of actions is as follows: open, bring tables to one structure (database structure of the new site DB), export / import. Next, you must copy all the images (not system pictures) that relate to the materials from the /images folder of the old site to the /imagesfolder of the new site. After that, by opening the admin area of ​​the new site, you will see the menu, categories, and materials. And here, in the admin area of ​​the new site, you need to open the menu manager, category manager, material manager, select all materials and click the "Batch processing" button. A window will open in which all items are filled in so that no changes are made. Just click the "Run" And processing will rebuild all materials.

If you do not do this, then when you open and edit the material, it will not be saved when you issue an error.

There was a case, I had to transfer material from DB joomla 1.5 to DB joomla 3. There the structures are very different. As a result of the transfer, all access fields of the tables with materials were zero. In order to put the attribute access in all 350 materials equal to one, I had to write a simple php-script:
// Connection to the database server
mysql_connect("хост", "user", "password") or die (mysql_error ());
// Celect database
mysql_select_db("database") or die(mysql_error());
while ($id<350) {
$strSQL = "UPDATE `dfdhf_content` SET "; //Instead of dfdhf put your table prefix
$strSQL = $strSQL . "access= '1' ";
$strSQL = $strSQL . "Where id =" . $id;
// The SQL statement is executed
// Close the connection to the database
echo "ok";

Also, note that some templates written under joomla 2.5 do not work under joomla 3.x because they use calls to old joomla 2.5 functions that are not in joomla 3.x. There have been cases where I had to replace these old functions in the template with equivalent new ones that are used in joomla 3.x. In this situation, since there was an idea to update the appearance of the site, I wrote a completely new template for it. After all this, I just moved the finished site on a new engine to the main domain folder. As a result, I got a site on joomla 3.x with the completely copied content of the old site. Perhaps that's all. In this way, you can transfer the settings of components and modules. Plugins. Or transfer the site content from the Joomla engine to the Wordpress engine.  

Good luck.

Автор: Darkeye.  

Another interesting thing in the network.



Go to the article feed.

Добавить комментарий

Защитный код