Merging 2 Woocommerce Databases - database

I've got two Wordpress+Woocommerce stores, one is for wholesale, the other is a regular store with an existing database. My client wants to merge the two.
I've:
Exported wholesale products, and imported them into the regular store
Exported wholesale users as a CSV, and imported them into the regular store
Repeated the process for orders
The issue I'm having is, I can't import users as is, as some users in the target store have the same ID (although they're different customers, different names, different email addresses). They get skipped when importing, otherwise, I'd be updating or overriding existing users.
I've tried editing the CSV before import by giving users new IDs I know aren't in use. The import went fine until I noticed orders aren't linked properly. All orders are under 'Guest' instead of being linked to their user. Products aren't linked to their order either, although their ID and SKU have been kept the same.
How can I make this work?

Related

Should I use database id or create new temporary id as key for React row

I'm making a table with React, where the user can add new entries, and I'm deciding what to use as a key. I'm considering these options:
Use database id. But this will force me to talk with the server every time the user wants to add a new entry, which is not ideal.
Generate a front-end id for each row and persist it in the state
Option 2 clearly seems better, but I see the React docs recommend using database id.
I've dealt with this same dilemma many times over different projects, and I've never figured out the best solution, so I decided to get it answered once and for all.
It sounds like you might want to go with Option 2 for any data that hasn't been saved yet to the DB.
Recommendation is correct to use the DB id when available, but seeing as how your requirements allow for temporary or "draft" entries then I see no problem with Option 2. Just be wary of how you generate these temp ID's as you'll want to prevent clashes with existing ID's in the array.

Access file sharing

I have a nicely designed access database, complete with layed out forms and macros behind many buttons that filter through search boxes and do many other functions.
My problem is that I am sending this database to multiple people who want to add new records, however when they give me back their edited database (now with new records", i cant import them, because another person who has also handed me their edited version of the database needs their records added and access doesnt allow me to import these records because unique ID's have been created by both people and clash when i try to import them both in.
I have tried some websites that claim to import my database and allow cloud editing, however i lose all the functionality and layout of my forms / macros as the websites dont support it.
What would be the best solution so that i can get multiple people adding new records at the same time? Are there any websites that offer this? Or is there a way inside access to reassign the Unique ID's if they are already in the system?
Set the field size of your AutoNumber ID fields to Replication ID instead of Long Integer. It is extremely unlikely that two users will create records with the same ID.
Split the database into frontend and backend parts. Backend sits on server and frontend links to backend. Each user runs their own copy of frontend. However, if your users do not have access to same network, you are in a pickle. Have you looked into Sharepoint and Azure?
I have designed a db for users that did not have connection to our network. These were construction site field offices. The main office had the master database. Field offices were given an Access file where they entered records during life of the project and at the end they sent in the file and code in the master imported records. Since all data was new there was no concern for conflicting updates. Simplest way I found to accomplish was to not use Autonumber primary key.
I do have another db that required merging data from multiple Access files and those files did use Autonumber primary key. The import code was more complicated.

Designing a database for tracking location affiliation from multiple sources

I need a database (not even close to a warehouse yet) that will serve as a master record of office locations and certain attributes associated with them. I have an initial source file, but also will be adding to that information from a number of other supplemental files. Some of the additional information will simply be records I can join to after matching. And some will be information I create once I've validated some status or have some internal knowledge on a location to store.
The source data is mostly flat files - some updated every few months, some annually. I am looking for design advice including ideas for how to query the database later.
I want to be able to start with the records in the initial data source, leave it alone, and then do a number of things in a new database:
if we verify the address, etc. from the initial source, I want to flag that and be able to give it precedence
if we can match a record in the initial data source to a record in one of the other data sources, I want to pull one or both records via query
if a location is participating in a specific program, I want to store that flag, regardless of which source I will keep for the address, etc., i.e. there is information related to a record that is separate from any of the different sources.
So, I was starting to think about something similar to a Star schema, but with a fact table pointing to the separate source tables based on some matching logic. My fact table would have records that include the keys of any of the other sources that are related. And it might also have additional columns for our added info on each record that is separate from the sources.
I was also thinking about just building a table that holds some kind of copy of the current info from each related source - or perhaps a view. But this may not be robust enough to serve as a basic source-of-truth database given all the flags and other additional info I expect to start adding.
This is not a large database - in the tens of thousands only - and does not need high availability to many users/queries. Eventually, I will want to join it to list of individuals at the locations. I'm hoping I can join the people to the places easily after I've got the main locations table built.
I realize this is question has a broad scope. I'm not an experienced database designer and I've searched for advice already but haven't figured out how to describe my challenge so I get relevant search results. All advice and references are most appreciated!
I'm working in SQL Server 2012

Collect data from 80 users, hiding other user's data

My wife works for a medium sized retail chain. Managers from each of the 80 outlets have to fill in one row of performance info for each of their staff (900 in all), but aren't allowed to see the data of other stores' staff.
My wife currently manages this with lots of spreadsheets, because each month the executive change what they want to collect, and their IT team don't have the resources to update their SAS system. She has to manually compile all the data into 1 spreadsheet for analysis which is time consuming and error prone. She's recently gone from having to do this for 20 outlets to 80 outlets and thinks she must be an easier way.
Is there a simple form based system, that can leverage what is already installed (microsoft office and lotus but not MSAccess), or can be run from a network drive. Cloud apps are banned. Excel's security is all wrong. Can word form templates append to a shared data source? Any ideas?
TIA
You could have a single table with all the data, then create 'shadowtables' on this table for each individual store.
in MySQL this would probably be either a 'partition table' (I've never used this so not sure how it works) or the use of temp tables.
You would then need to implement a method whereby when a user logs in at a given location (IP address) a trigger would create the temp table, then populate it with the relevent data for the store at that IP address.
An alternative (probably easier too) would be to have a specied table for each store, then grant users specific priveleges on each table you create. Again you'll need trigers to either populate a single 'master table' with info as it is updated, or you will just send a
select * from outlet1, outlet2... outlet80
again you may decide to create a temp table from the above select, and implement a custom script to create it only when required.
In fact that is probably how I would do it.
Then in you web interface have a button to create the temp table, and display it to the current user (provided they have the required priveleges to view all the tables of course).
I don't know for certain if Lotus is able to implement this, I don't know about its 'database' solution. I know that to do something similar in Access isn't that hard, the only downside would be needing to handle user identification (which Access doesn't do natively), again I don't know about Lotus.
In my experience the 'flat file database systems' don't generally handle user permisions in a native fashion, it is put onto the interface development to hand this.
I'm not sure how helpful the answer is, but it may take you a little way to a solution (even if you end up going for a server/client dbms system)
You can use Lotus for this. A simple start for you:
Create a database with one form and one view
On the form add whatever fields you want but also add a computed-when-composed multi-value field of type "Readers" with formula:
"[Admin]" : #Name( [CANONICALIZE];#userName)
With the exception of those with an Admin role (e.g., your wife), the view will display to each user only the records that the user created. The users will have to create one record per row.
Alternatively you could create an agent in the database that reads the data from an Excel file and builds the documents (records) with the READERS field's value computed as the documents are created.
If that's the route you want to take post a reply here and I'll post some code to (i) prompt a user to select an excel file, (ii) read the excel file data into lotus notes, (iii) implement a READERS field to see that documents are kept confidential between the creator and the Admin role people.
Hope that helps.

magento - migrate sales tables

I need to transfer sales tables form an old magento database to a new one
How can i do that without deleting the records from the new database and which are the sales tables
Given how complex Magento's schema is, I would advise against directly writing into the database. If you still want to do it there is this article that might help you understand the process as well as all the tables involved. Generally speaking the tables are prefixed with 'sales_'.
Since Magento's core import/export functionality is limited to Products and Customers, your best option is probably to look for an extension that will do this, or write your own. Here is another question on SO that is related to this, providing a link to some paid extensions that do this.
The sales ID's shouldn't conflict, assuming you do intend to transfer your customers as well since there may also be new that correspond to the sales. To keep this simple and short, which this process really is once you know which tables to export, you do the following:
Export all customer_ and sales_ tables (these may have a prefix, and will look like something like yourprefix_customer.
Then, you make sure that the last orders ID is updated in the eav_entity_store table, to make sure that Magento created new orders with the correct ID's. You would do the same for the other 3 rows within eav_entity_store which are for invoices, shipping and creditmemos.
Here more detailed tutorial on this topic if needed.
I strongly recommend use a plugin for that situation.
This free plugin worked for me, just install through Magento Connect and then (after refresh cache) you'll see "Exporter" tab on menu with option for import and export.

Resources