MySQL data transfer/update to another database - mysql

I have a forum which is here or http://neue.st/index.php
and I want to transfer the data from that forum to a new forum in a different directory http://neue.st/forums
I also only want to have select pieces of data to be transfered such as users, posts, topics, forums but not things like themes & mods
I am doing this because I kinda of screwed up the data for mods & themes for the original forum & have no idea how to reverse it because I forgot to do the backuping
Is there anyway to do this with phpmyadmin

A good tool to use... but not absolutely necessary is PMA (phpMyAdmin). You should log in, click on the database you want to export data from and then click the export button.
You can see there is a "custom" choice, upon selecting that you will be presented with more options including the ability to choose which tables you need to export.
After that, head on over to your other database and import the SQL file that was generated/downloaded and happy days.

you can use SQLYog community edition, it is easy to select what ever data you want to export.

If you download the Support toolkit from phpBB you are able to 'clean' the database of all non standard tables and rows (i.e. things added by MODs), leaving you with a clean database.
For themes that you no longer need, you can delete and uninstall these via your Admin control panel before removing them from your server.
If you just use 'selected' parts of your database then chances are it won't work properly because there are so many relationships between the different tables.

Related

Problem exporting and importing articles within two Joomla 4 installation via Mysql

via mysql database, I am trying to export articles from a Joomla 4 installation to another joomla 4 installation, but I can figured it out.
I've copied these tables of the joomla4 database:
jos_content
jos_contentitem_tag_map
jos_content_frontpage
jos_content_rating
jos_content_types
Than I have imported into another fresh Joomla4 installation, I can see the articles that are imported in the new database but from the backoffice I can't see any articles there.
Maybe I forgot to export some necessary table?
I use the same way to import menus and modules, and it works fine, but when with the articles it does not work.
Does anyone can help me?
Many thanks.
Filippo
You have missed off the categories table? Do the categories match up?
Also, check the access rights too. The groups/levels maybe different and you are not assigned to the rights that are assigned to the imported articles.
I would tend to advise using CSVI to export/import too as this maps the field etc accordingly without a DB Export/Import.
The best way to do this is to empty the target database, copy all the tables to that installation, and then see if it works. If you want to make some modifications to the target database/website, then do it after copying all the tables. This is a cleaner approach than copying a few tables if the target website is just empty.

WordPress WooCommerce Staging Site Database Sync

I manage a WordPress WooCommerce site which has a couple mishaps in the recent past. There is no staging environment setup which would have prevented the mishaps and is not trying to set one up.
I have researched many WordPress DB Sync plugins, however, not many states they work well with WooCommerce. The issue is on my side, the product team can update add/remove products, categories, blog posts, etc. at any given time, they have no set time-frame window which updates the site.
I need a way that I can sync menu structures, products, and all, blog posts, etc. with the production environment. I need to sync, because while the product team is working new orders come in and comments are posted, etc.
Is there any easy way to set up a staging site that will accomplish this?
Daily, I work with MSSQL and write a lot of SQL, so I thought I could write a sync script for moving/syncing data to production, however, the command I needed "MERGE" is not available in MySQL. Or, is there a way WordPress can run on MSSQL?
Any ideas?
My suggestion, you can use default WooCommerce Import and Export available on the Product page on the top side.
It is the best option to save all database in Raw format and easily restore as per your need.

Phpmyadmin vs Jetbrains Datagrip for database management

I have been working with Phpmyadmin for quite some time and recently i came across Jetbrains Phpstorm and Intellij which i both really liked.
Now i found the database environment Datagrip.
I wanted to know objectively:
what are the advantages of Datagrip over Phpmyadmin and vice versa.
What does Datagripgive me that Phpmyadmin lacks?
What does Phpmyadmin give me that Datagrip lacks?
I am using PhpStorm and Datagrip since February 2017. Before that I was using Dreamweaver and PhpMyAdmin.
The only thing PhpMyAdmin had an advantage over Datagrip from my perspective, was searching the whole database. But since 2019 Datagrip has a "full text search" which does exactly the same.
Furthermore:
Datagrip is fully integrated into your IDE (PhpStorm, PyCharme, IntelliJ, etc). You don't need to leave it to run any SQL queries.
within the SQL console you have access to the "live templates" which let you insert huge code snippets impossible to remember via typing a few letters of the live template name. Before:
after:
SQL consoles are saved automatically (by a consecutive number). And you can save them as SQL files to any directory right from the console via ctrl/cmd + s
you also have access to the IDE's huge clipboard with (in my case) 100 previously copied text pieces, while each of them can be a whole (SQL) document:
it so easy to modify a table without writing any queries (table name, column name, foreign keys, indexes, column data type, etc):
the tables and search results are super easy to edit and update as if you would edit an Excel table
you can assign to /setup on any project as many databases as you like and access them easily
you can assign/setup and access any remote database via an SSH tunnel
you can assign/setup any type of DBMS:
Datagrip checks the SQL query syntax live, before you even run it
this is my IDE setup for testing query time on two identical sites running on different server setups (the one on nginx/mysql and the other one on Openlitespeed/Mariadb):
All that you get only for a couple of bucks! I pay now for PhpStorm only 80€ annually! I pay often much more for a single site license of some shitty wordpress plugin! But get a really really high quality software product with PhpStorm. Seriously, probably the only company I would LOVE to work as employee (being freelancer throughout my whole dev "career") is probably JetBrains. It seems as they can read my thoughts :D. Sure there are some few minor issues. But any time they bring out a new version I am excited as a child.
No I'm not paid by JetBrains :D And no I don't hype them because I'm Russian. At the time I felt in love with them I thought it is a Czech company with a bunch of Russian devs (nothing unusual in Europe). And Czech's in general don't like Russians. So I loved them even I thought they wouldn't love me :D Only a year after I've switched from Dreamweaver to PhpStorm I've found out it is a fully Russian company.
The only thing I hate in Datagrip is that the SQL console output shares for any reason a tab/window with Docker (dafuq?) and it is a huge pain in the as* to navigate between multiple query outputs/results (as in the example above where I compare the performance of two servers)
Update:
the only flaw of Datagrip from my perspective (pain in the as* to switch between console outputs) has gone now as well! :D
I've found a setting by which you can just simply open a "services" tree (Command + Shift + T) which list all the active/latest "services". I still don't understand why the Datagrip console output doesn't have a dedicated window, but at least I can now navigate easily between the different console's output:
What does Datagripgive me that Phpmyadmin lacks?
DataGrip provides fast code completion, based on the syntax — it can even complete your JOIN clause based on foreign keys.
It also has data editor — so you can edit several cells at once or you can edit many rows locally and then submit them.
Also you can navigate inside the grid y foreign keys.
Multi-cursor in the editor can help you edit a bunch of statements.
What does Phpmyadmin give me that Datagrip lacks?
PhpMyAdmin can export to PDF, ISO/IEC 26300 - OpenDocument Text and Spreadsheet, Word, LATEX
PhpMyAdmin has more administration features, dataGrip is not focused at administration at all
It also supports working with user accounts and privileges

How to selectively export mysql data for a github repo

We're an opensource project and would like to collaboratively edit our website through github public repo.
Any ideas on the best solution to export the mysql data to github, as mysql can hold some sensitive info in it, and how we can version the changes that happen in it ?
Answer is you don't hold data in the repo.
You may want to hold your ddl, and maybe some configuration data. But that's it.
If you want to version control your data, there are other options. GIT isn't one of them
It seems dbdeploy is what you are looking for
Use a blog engine "backend-ed by git", forget about mysql, commit on github.com, push and pull, dominate !
Here it is a list of the best:
http://jekyllrb.com/
http://nestacms.com/
http://cloudhead.io/toto
https://github.com/colszowka/serious
and just in case, ... a simple, Git-powered wiki with a sweet API and local frontend. :
https://github.com/github/gollum
Assuming that you have a small quantity of data that you wish to treat this way, you can use mysqldump to dump the tables that you wish to keep in sync, check that dump into git, and push it back into your database on checkout.
Write a shell script that does the equivalent of:
mysqldump [options] database table1 table2 ... tableN > important_data.sql
to create or update the file. Check that file into git and when your data changes in a significant way you can do:
mysql [options] database < important_data.sql
Ideally that last would be in a a git post-receive hook, so you'd never forget to apply your changes.
So that's how you could do it. I'm not sure you'd want to do it. It seems pretty brittle, esp. if Team Member 1 makes some laborious changes to the tables of interest while Team Member 2 is doing the same. One of them is going to check-in their changes first, and best case you'll have some nasty merge issues. Worst case is that one of them lose all their changes.
You could mitigate those issues by always making your changes in the important_data.sql file, but the ease or difficulty of that depend on your application. If you do this, you'll want to play around with the mysqldump options so you get a nice readable, and git-mergable file.
You can export each table as a separate SQL file. Only when a table is changed it can be pushed again.
If you were talking about configuration then I'd recommend sql dumps or similar to seed the database as per Ray Baxters answer.
Since you've mentioned Drupal, I'm guessing the data concerns users/ content. As such you really ought to be looking at having a single database that each developer connects to remotely - i.e. one single version. This is because concurrent modifications to mysql tables will be extremely difficult to reconcile (e.g. two new users both with user.id = 10 each making a new post with post.id = 1, post.user_id = 10 etc).
It may make sense, of course, to back this up with an sql dump (potentially held in version control) in case one of your developers accidentally deletes something critical.
If you just want a partial dump, PHPMyAdmin will do that. Run your SELECT statement and when it's displayed there will be an export link at the bottom of the page(the one at the top does the whole table).
You can version mysqldump files which are simply sql scripts as stated in the prior answers. Based on your comments it seems that your primary interest is to allow the developers to have a basis for a local environment.
Here is an excellent ERD for Drupal 6. I don't know what version of Drupal you are using or if there have been changes to these core tables between v6 and v7, but you can check that using a dump, or phpMyAdmin or whatever other tool you have available to you that lets you inspect the database structure. Drupal ERD
Based on the ERD, the data that would be problematic for a Drupal installation is in the users, user_roles, and authmap tables. There is a quick way to omit those, although it's important to keep in mind that content that gets added will have relationships to the users that added it, and Drupal may have problems if there aren't rows in the user table that correspond to what has been added.
So to script the mysqldump, you would simply exclude the problem tables, or at very least the user table.
mysqldump -u drupaldbuser --password=drupaluserpw 0-ignore-table=drupaldb.user drupaldb > drupaldb.sql
You would need to create a mock user table with a bunch of test users with known name/password combinations that you would only need to dump and version once, but ideally you want enough of these to match or exceed the number of real drupal users you'll have that will be adding content. This is just to make the permissions relationships match up.

Share logins between 2 databases or?

I have a personal website using a MySQL database (with justhost.com). The registration is very simple and only requres a username, pw, and email. I want to add an Oekaki to my site, but the Oekaki install instructions say it should have its own database. If I input the database I am currently using, will that screw it up, or will it create a new table within that database so when a member logs in, they have access to the Wiki and Oekaki under the same username and pw?
Please note I am a database newbie. I am using TikiWiki 6.2 currently and at its initial install of TikiWiki 5 created its own database. If the above won't work in any way, after I create a new database for the Oekaki, what would I have to do so it uses the current registration information from my TikiWiki database without me having to manually enter in every single user one by one for the Oekaki side of the site?
Any information is helpful, even if it just helps me learn a little bit more about databases. :)
I don't know any of these software you mentioned. But i can say in general if a software itsself recommends to use one single database for it you should do it.
I had a similar problem with my wordpress blogs database and another organisational software i installed. The next day all my blogs content was gone forever.
It could be, that for example the software just throws all existing tables away.
So my answer (or better advice) is. Be careful and if you can avoid it, don't throw together two applications in one database.
For the user-table thing you could probably just change one of the systems to use only the user-table of the other system. So nothing will be screwed up. Or if you have the opportunity make a third "General" Database where you just put your users data and use it in both systems.