News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Backup and Restore ~ PRODUCTS & CATEGORIES ONLY~

Started by beltoforion, November 12, 2020, 17:33:08 PM

Previous topic - Next topic

beltoforion

Hi, Which tables are obligatory to export to backup and restore Products and Categories only from the database?

also has anyone made any backup and restore PHP file? it would be great to have it and include it in Virtuemart!!... or something to convert your data into the "sampledata.sql" file to just replace and use the Virtuemart Tools...

I used ROCSVI to backup the "products" but cant seem to restore the products using mysql. I had to make some modifications but still not working. I intend only for the products to backup since I have made so many changes to joomla backend and I want to make a clean install with products data only.

i only need Product backup (including categories)

by the way:
Joomla 3.9.22
VirtueMart 3.8.4 10335 (will upgrade after migrating products)


wanting to learn to create good templates

AH

Well that is a simple question that hides what you are trying to achieve:-

I could say obligatory is:

virtuemart_product*
virtuemart_categories*
virtuemart_category_categories
virtuemart_customs

but then you have no tax tables - which are sort of needed
and so too are shoppergroups so - then you need shoppergroups
and you need a vendor
and a vendor user


So you may want to specify a bit more as it really depends on your from > to environments.


Alternatively -

Try moving over the obvious ones in a test environment  - and see what falls over.


Maybe the simplest option is to backup and restore all VirtueMart tables then clear out the orders and invoices historic data etc

My snippet for clearing out data is is something like this:


TRUNCATE YOURTABLEPREFIX_virtuemart_invoices;
TRUNCATE YOURTABLEPREFIX_virtuemart_orders;
TRUNCATE YOURTABLEPREFIX_virtuemart_order_calc_rules;
TRUNCATE YOURTABLEPREFIX_virtuemart_order_histories;
TRUNCATE YOURTABLEPREFIX_virtuemart_order_items;
TRUNCATE YOURTABLEPREFIX_virtuemart_order_item_histories;
TRUNCATE YOURTABLEPREFIX_virtuemart_order_userinfos;
TRUNCATE YOURTABLEPREFIX_virtuemart_carts;
TRUNCATE YOURTABLEPREFIX_virtuemart_payment_plg_paypal;
TRUNCATE YOURTABLEPREFIX_virtuemart_payment_plg_standard;
TRUNCATE YOURTABLEPREFIX_virtuemart_shipment_plg_weight_countries;




NOTE that if you have varying plugins /language etc you may need to truncate those tables!!
Regards
A

Joomla 4.4.5
php 8.1

beltoforion

Thank you for your reply AH,

So  let's say for example I have this information, in my table I would have to backup all that have information right? for a full backup... and then upload these to the other database.



Table    Rows
__virtuemart_adminmenuentries   29
__virtuemart_calcs   4
__virtuemart_calc_categories   0
__virtuemart_calc_countries   0
__virtuemart_calc_manufacturers   0
__virtuemart_calc_shoppergroups   0
__virtuemart_calc_states   0
__virtuemart_carts   1
__virtuemart_categories   85
__virtuemart_categories_es_es   85
__virtuemart_category_categories   85
__virtuemart_category_medias   0
__virtuemart_configs   1
__virtuemart_countries   246
__virtuemart_coupons   0
__virtuemart_currencies   163
__virtuemart_customs   11
__virtuemart_invoices   0
__virtuemart_manufacturercategories   0
__virtuemart_manufacturercategories_es_es   0
__virtuemart_manufacturers   121
__virtuemart_manufacturers_es_es   121
__virtuemart_manufacturer_medias   0
__virtuemart_medias   10,943
__virtuemart_migration_oldtonew_ids   0
__virtuemart_modules   12
__virtuemart_orders   1
__virtuemart_orderstates   8
__virtuemart_order_calc_rules   12
__virtuemart_order_histories   5
__virtuemart_order_items   3
__virtuemart_order_item_histories   12
__virtuemart_order_userinfos   1
__virtuemart_paymentmethods   1
__virtuemart_paymentmethods_es_es   1
__virtuemart_paymentmethod_shoppergroups   0
__virtuemart_payment_plg_stripe   0
__virtuemart_products   10,106
__virtuemart_products_es_es   10,106
__virtuemart_product_categories   10,098
__virtuemart_product_customfields   20,212
__virtuemart_product_manufacturers   10,100
__virtuemart_product_medias   9,937
__virtuemart_product_prices   10,111
__virtuemart_product_shoppergroups   0
__virtuemart_ratings   0
__virtuemart_rating_reviews   0
__virtuemart_rating_votes   0
__virtuemart_shipmentmethods   1
__virtuemart_shipmentmethods_es_es   1
__virtuemart_shipmentmethod_shoppergroups   0
__virtuemart_shipment_plg_weight_countries   1
__virtuemart_shoppergroups   2
__virtuemart_states   881
__virtuemart_userfields   28
__virtuemart_userfield_values   19
__virtuemart_userinfos   1
__virtuemart_vendors   1
__virtuemart_vendors_es_es   1
__virtuemart_vendor_medias   1
__virtuemart_vendor_users   0
__virtuemart_vmusers   1
__virtuemart_vmuser_shoppergroups   0
__virtuemart_waitingusers   0
__virtuemart_worldzones   0
wanting to learn to create good templates

Jörgen

As AH sais, it depends on your needs, but yes this VM data should be moved to a new database. You will see if it works or not.

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

beltoforion

my specific need is Only Products and categories and all its related needed tables. The thing is I don't know for example the relationship of tables its Obligatory to export/import to be able to work as is.

I dont want TAXES, INVOICES, HISTORY, ETC.. Just want a plain Import export products and categories.

Yes, these categories have subcategories... lol sorry for continuing the questions but seems we don't have a specific answer since I cant explain myself clearly :(
wanting to learn to create good templates

pinochico

#5
For custom isues from our clients type:

"I only need"

we use custom developing.

We have a lot of migration php files or 3d party migration tools - every customers has different "I only need"
The pay 1-4 hours work and then they have new "I only need"
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

beltoforion

 I do pay sometimes for some services and I usually use FIVERR, UPWORK, FREELANCER, etc. This time I would like to learn if that is not a problem for you guys. I understand most of people who answered knows how to do it but I wish we could share a little knowledge from now and then.

Sometimes i take courses (mysql, php, cssgrid, etc etc. ) and like to pay for them but sometimes I come back to the "open source" community expecting some passion to answer lol. I really like  Virtuemart and wouldnt want to change it because I couldnt learn more obviously. I have used Woocommerce before too. I am just starting a website and its been in the Project status for long time and I wish I could just get more knowledge from our forums. I really hope you guys get a lot of jobs requested and wish you the best, this time only I was expecting a answer to guide me on what to look for. For all of you who responded I appreciate your time and effort on trying to reply to my doubts and I really hope I don't offend no one.

now if anybody is interested in providing the service send me a PM I can chat with you if you like. ;)

wanting to learn to create good templates

beltoforion

or if anybody want to answer with an example code maybe? something like go to the backup place PHPMYADMIN, run this and then go to the PHPMYADMIN of destination and type this? would really appreciate it ;)
wanting to learn to create good templates

AH

beltoforion

My suggestion is to do this with one or two tables to get the hang of the process - when I first started with all of this years ago - I had no idea what to do (so I feel your pain!)
After a few "interesting" attempts - it becomes much easier. You may also realise why people dont bother paying for someone to customise a VM PHP solution - simple answer is that everyone's needs are slightly different and  PHPmyadmin (and similar tools - I use heidisql) already provide much richer and more flexible solutions.

You are nearly there with your answer.

Best to use some different language here to hopefully reduce confusion:

1: Using PHPMYADMIN -> choose the database -> choose the tables you want -> and use Export

  You will be saving the tables to a file "tablesiwanttomove".sql  this contains the tables you selected, along with the SQL to recreate these somewhere else in IMPORT.

The tables should be:
Every virtuemart.*
PLUS you may need to move over the Joomla user* tables (because you probably want to keep that Joomla user for VM ) Note that this will clear all users from the target database. In the future it is unlikely that you need to do this again.


2.  Using PHPMYADMIN -> IMPORT into your target database -> choose the file you exported.

3. NEXT - If you use a different prefix in the new database - you will need to change the prefix on all the imported tables.

PhpMyAdmin allows you to do this. At the "Database" level select the Structure tab to see all the tables. Click 'check all' (below the table listing) OR check the ones you want to change. On the 'With selected' dropdown choose: 'Replace table prefix'.

4. Then you can clean out any old order data from the tables:

By pasting the SQL commands into SQL window and hitting GO


TRUNCATE YOURTABLEPREFIX_virtuemart_invoices;
TRUNCATE YOURTABLEPREFIX_virtuemart_orders;
TRUNCATE YOURTABLEPREFIX_virtuemart_order_calc_rules;
TRUNCATE YOURTABLEPREFIX_virtuemart_order_histories;
TRUNCATE YOURTABLEPREFIX_virtuemart_order_items;
TRUNCATE YOURTABLEPREFIX_virtuemart_order_item_histories;
TRUNCATE YOURTABLEPREFIX_virtuemart_order_userinfos;
TRUNCATE YOURTABLEPREFIX_virtuemart_payment_plg_cardstream;
TRUNCATE YOURTABLEPREFIX_virtuemart_payment_plg_stripe;
TRUNCATE YOURTABLEPREFIX_virtuemart_shipment_plg_weight_countries;
TRUNCATE YOURTABLEPREFIX_virtuemart_carts;




OR you can select these tables and -> with selected -> at the bottom of the php table list - do with selected -> EMPTY
Regards
A

Joomla 4.4.5
php 8.1