Importing databases in prestashop - php

I have a big database in Access with products I want to insert in Prestashop!
I've read about the database import in prestashop but didnt find anything about access db import. Is there a way to import this database in prestashop?
Or am I supposed to write sql queries to add these products. I have read the source code of prestashop like Products.php or ObjectModel.phplike said here:http://stackoverflow.com/questions/16068141/prestashop-insert-products-script. So is the only way to write sql queries?
Thanks!

PrestaShop have tools to import products from CSV, you can check it in BO > Advanced Parameters > CSV Import. You can choose what you want to import, products, categories, attributes etc. If your file is too big you supposed to split it to few small files.

As Agnes said CSV will be the option.
Since I still don't have enough rep I can comment on his response but I'd like to add that in the CSV import page you can find templates for the CSV may be useful if you are not used to Prestashop Product Fields.
Also if you upload the images to a temporal folder and add the URLS in the product CSV the images will be imported and added to the product.
If is the first product upload I'll also recommend you to set up the IDs for the products this way if something doesn't fit or you want to change the uploaded products you can do it just by ID or simply delete all previous products and import the new ones.
Good luck.

Import is very complecated in PrestaShop, and not really fonctionnal.
I recommand to use the module Migration pro. Is a paid module, but it works really fine, i've used it a lot.
Otherwise, you can read this article (in french), you have the list of table to import. After that, you can import images and regenerate them.
Good luck ;)

Modern Prestashop can directly import xls/xlsx files
It is much better choice than CSV because you don`n have mess with field delimiters.
Export from Access to Excel should not be problem.
Native Import through web admin GIU is very good.
But you need some practice:
Make file with few products - you can delete them later if you not satisfied with results of import.
Look carefuly at field mappings. Maybe you will fail at first attempt or miss some mapping - thats why you need to import few products first.

If possible try to use the built in webservice api or you can make your own custom import module

Related

How to import Wordpress database to pure PHP MySQL website?

I am currently in a project which develops (actually re-designs) a news company website. Their old website had been developed using Wordpress (Latest version). And, now we are developing brand new custom design website using PHP and MySQL. But, they have over 10,000 news (posts) on old wordpress database. All I need to know is, how do we import all those post data to our main database? Our database and table structure is way different from wordpress one. Are there any SQL commands to import just only single or couple of columns data and paste them to another database table? Your help is highly appreciated.
Pull them down into a CSV, update the fields as required, import them into MySQL...
A CSV is a file of Comma separated values: https://en.wikipedia.org/wiki/Comma-separated_values
Plugin to get Posts as CSV: https://wordpress.org/plugins/simple-csv-xls-exporter/
Edit the field names (in a text editor or something that can edit CSVs and save them correctly), remove data you don't require etc etc. then import into your database.
Here's a handy link to import CSV into MySQL: How to import CSV file to MySQL table
Does that make sense?
If you know how to use MySQL , you make queries that can fetch the data and like that you can fetch all the data from MySQL import it in a way that you need in your new website and export it there. if You don't understand.
Step 1 :
Know that is required this is very basic step, you should know what you need and make a list of it.
Step 2 :
Make MySQL queries and fetch the data according to your database structure, use excel if your not so good in MySQL , organized as data as requirement
Step 3:
Now you will have all the data, you can either convert that to csv or sql format and insert in to your database easily.

PrestShop: Import from XLS?

Is there a possibility to import XLS Files into Prestashop? I would imagine myself a Script where I define which rows (as an Example A1-A300 should be Names of the articles, etc...) are what (Like name, price, Tax, etc...).
How could I realise that? I hope there is a possibility and I would appreciate if anyone could get ma on the right path.
PrestaShop doesn't support excel files, only simple data tables like .csv. This is because excel files are too complicated, they can by whole programs by themselves.
However, if you're working for a client or your XLS files are just simple data, then surely you can convert XLS to CSV before import.
You just need to make an override for AdminImportController::ajaxProcessUploadCSV
and basically "intercept file upload". Get the uploaded file and convert it to CSV using this library:
https://github.com/PHPOffice/PHPExcel
Then just return are the right values in your override to simulate that "everything is running normal" (basically trick PrestaShop :)) .
It is definitely doable, I've created such module for a client, PHPExcel gave us the ability to work with cells before saving them to CSV.
If you need to import products form Excel without converting to CSV, there is extension, Store Manager for PrestaShop - https://www.prestashopmanager.com/free-download/
It is paid, but you can do the task with 2-week version without any fees.

Migrate Codeigniter Database to Wordpress

I have been trying to import or migrate the Codeigniter database into wordpress. Is that possible to do by any means? I have searched for the solution for it at many places but was unable to find a relevant solution to it.
The real problem is that I have already got a website created in CodeIgniter but now I am making a new site for the same using Wordpress. I need to import all the data and posts contained in the older site into the new one. Maybe database migration can be a easier idea. How will be doing so??
Codeigniter is a development framework for building applications. WordPress is a system that's already built. I think you could build a large application like WordPress with Codeigniter. But it would then rely on Codeigniter's libraries and framework, so to make that happen I think you would have to rebuild WordPress from scratch. Unless Codeigniter can be used as more of a PHP editing framework as well?
Maybe a Codeigniter guru will weigh in.
Source https://wordpress.org/support/topic/codeigniter-wordpress
The main issue with this is that your CI database is not structured the same as wordpress database.
There are some tools that help you import databases in wordpress like this plugins:
WP Ultimate CSV Importer Plugin
Really Simple CSV Importer
CSV Importer
but you will have to provide them the CSV file, that you'll have to export from your CI website. I don't think the import process is very complicated but it's sure easier if you spend some time understanding wordpress databse structure, for that a great resource is the wordpress code and the Database Description page.
The complexity of the CSV file is determined by the objects that you have to import in WordPress here is a check list that its good to have when you start building a CSV file:
1) Are you importing custom post types or just blog entires?
2) Do you have extra info on your import objects that have to be imported as custom fields?
3) Do you have users that you need to import? if you do, what roles do you need to have? do you require custom roles (this makes things very complicated)
4) Do you objects have images attached to them? if they do you'll have to make sure that the import plugin is able to import images!
5) Do you have categories and tags? do they have extra info besides wordpress default info?
When I have to import data to WordPress I try to keep it as simple as possible, I'm trying to import only blog posts and their images if possible depending on the complexity of the initial website I might import categories and tags too but I might split the process before adding this and process them after I have the posts in my wordpress site (this is because I'm more comfortable working with wordpress database and functions then with 3rd party CSV generated files - it might not be your case since you have full access to the initial CI website)
In the end have a look at the plugins I've linked or search yourself some import plugins and check the CSV files they need and try to make the CI website generate a CSV file that is similar with the ones in the examples.
If you have experience with the WordPress databse structure then you can also create a script that loads your data from one database to the other one (I recommend this approach for developers that have experience with both the old websites and WordPress at code/database structure level.
if you can share your databse scheme some extra info might be given.
Export posts from CI database in CSV/XML format or SQL and then change it to CSV accordingly. after that, use WP all import plugin and select the columns correctly. Easy as that..

Import products from Excel file

I am new to Magento and I have a question about products import. I have the xls file with over 9K positions (products) wich I need to import. For each product in this file there are basically sku, name, price and descriprion attributes. I am familiar with the basics of import/export in Magento. I’ve already exported some test products into csv file to get the structure for import csv. This file of course contains much more attributes than the one i need to import. So my obvious question is: how can I create valid import csv from my xls file (not by hand of course)? The only solution I can see right now is to write some php code that will extract data from the xls file, add required attributes from export csv and save it as csv. Are there other solutions to my problem? Sorry if I am asking some obviuos questions. Googled, searched, found nothing.
Better way is to save excel as simple csv file and use Magmi for import to Magento. http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Main_Page

Handling dynamic CSV headings in PHP/Mysql

I know the title isn't the most descriptive, but I can't think of a better way to describe it.
Ultimately what I would like to do is this:
I am making a system that handles import of data via CSV from several different companies. Naturally, the format from each company is slightly different, with different amounts of data in each column/heading and a different arrangement.
I could either:
Hard code the file format into the program, which is quick and simple to program, but not abstract or future proof
or provide "dynamicity" by allowing users to configure "file formats" in the system, by dragging and dropping CSV headings and saving presets for each incoming file format.
I would like to do option 2, but how would I go about doing this?
I am guessing a tagging style system would do it... but any advice would be appreciated.
I am using PHP, MySQL, and CodeIgniter 2.0.2 if that helps, and also have access to all the Zend libraries in my app.
Assuming that users will be submitting a subset of possible data types that you define up front, this shouldn't be too tough.
A simple form that allows the user to select the data type and give you the field name in their csv could be used to create the templates you mentioned. Store these in a database table associated with the user and make them choose a template before importing a csv. For customers who have csvs without header rows, a slight variation where they tell you the column numbers for each data type.
I'd also suggest providing pre-defined formats for customers who haven't defined their exports yet. That way they could build their exports to one of your formats.
You could also let users define their default template. That way they wouldn't have to select the template every time they import data if they're always importing data in the same format.

Categories