CPanel WHM setup website locally and download database - database

Can someone please help me downloading a database from CPanel ?
I have a website hosted using CPanel WHM.
The database is huge.
I want to make changes to the website. But would like to work on it locally.
So I downloaded my website content.
When I try to download the database, the download gets stopped in middle because of the huge size of the database. How can I download the full database?

Since the database is huge, it can't be downloaded through phpmyadmin.
To download only through phpmyadmin, additional parameters like: php execution time limit, mysql time limit, mysql cache size etc etc needs to increased in files like php.ini mysql.ini
Instead mysqldump can be used.
Login to your site using SSH.
Eg:
>>ssh user#your_website.com
>>Enter password: your_password
>>mysqldump -u [uname] -p[pass] [dbname] > [backupfile.sql]
[uname] Your database username
[pass] The password for your database (note there is no space between -p and the password)
[dbname] The name of your database
[backupfile.sql] The filename for your database backup

Related

Import/Export PostgreSQL db "without" pg_dump or sql file / backup, etc...?

I need to import a old db into a new postgre server.
Is there a way to migrate an old database to a new server without using pg_dump?
I don't have the sql file, or the old server backup file, neither the user and the password, just the physical files in the "\data" folder, is there any way to do this?
The target server is in the same version of th old server.
Thanks.
Well as a test you could try:
pg_ctl start -D $DATA
Where pg_ctl comes from the target version and the $DATA is the the /data directory. You have not said how you came to have just a /data directory. If this came from an unclean shutdown or a corrupted drive the possibility exists that the server will not start.
UPDATE
To get around auth failure find pg_hba.conf and create or modify local connection to use trust method. For more info see pg_hba and trust. Then you should be able to connect like:
psql -d some_db -U postgres
Once in you can use ALTER ROLE to change password:
ALTER ROLE <role_name> WITH PASSWORD 'new_password';

move neo4j database from one server to another

I have a server that uses neo4j 3.5.x with docker. Now I want to move that database to another server.
This time I see that neo4j released 4.0. I just copied data folder which contains only graph.db
I run the script I used last time
sudo docker run --name vis --restart unless-stopped --log-opt max-size=50m --log-opt max-file=10 -p3001:7474 -p3002:7473 -p3003:3003 -d -v /data:/data -v /conf:/conf -v /logs:/logs --env NEO4J_AUTH=none neo4j
When I run this I see that I can reach it from 7474 which is fine. BUT it asks password to see the data. Though I didn't set a password WHY IT ASKS?
I tried everything possible like neo4j, 123, 1234, test or live it empty. none worked.
it gives error
neo4j-driver.chunkhash.bundle.js:1 WebSocket connection to 'ws://0.0.0.0:7687/' failed: Error in connection establishment: net::ERR_ADDRESS_INVALID
Is there a proper/robust way to import data between neo4j database servers? Can I use this https://neo4j.com/developer/kb/export-sub-graph-to-cypher-and-import/
If you go to the Neo4j desktop, and then select the graph. Open up Manage options. Then choose Open Terminal.
Once there you can use the database backup command. (Here is an example)
bin\neo4j-admin backup --backup-dir=c:/backup --name=graph.db-20200107
This will backup the database to the specified backup directory.
Then you can zip that backup directory, and then unzip the backup directory, and restore it on the new server.
(Here is an example)
bin\neo4j-admin restore --from=c:/backup/graph.db-20200107 --database=graph.db --force=true
Note: The 'graph.db-20200107' is an example of the name that you give the database backup. You can name it whatever you want.
-yyyguy

Moving Magento to new server checklist

So I'm trying to manually move Magento to new server with old school ftp/phpmyadmin method. I only have the sql dump and folders from the root of old server, not access to it anymore and I don't know the earlier magento version number.
Should I
do fresh install of Magento to new server and then substitute folders and somehow import sql?
or
dump the files and sql to the new server first and then run the installer (something else?)
Many thanks
Usually below methods are followed,
Empty your cache admin sessions
Empty your logs (mysql)
create backup your database and your files
check your new server that supports magento using this
upload your files and import your db. If your database size is very large then directly import your database to your mysql server using sql command. Command would be like this,
mysql -u username -p database_name < file.sql
for this you need to logged in your server(mysql)
Update your mysql credentials to your etc file and update path in core_config_data table .
Place some dummy orders to check emails are correctly delivered and payment, shipping etc.
Buy SSL Certificates and avoid shared hosting.

How to take database backup form WSO2 Stratoes Live Data Services Server

I have created database on the Stratoes live server and my databse URL is this.
jdbc:mysql://rss1.stratoslive.wso2.com/karshamarkuptool_karsha_opensource_lk
I tried Database Console> Tools> Back Up and it asking me these credentials
Target file name:~/backup.zip Source directory:
jdbc:mysql://rss1.stratoslive.wso2.com/karshamarkuptool_karsha_opensource_lk
Source database name: karshamarkuptool_karsha_opensource_lk
Are my credentials right? it says there is no database found on the source directory.
If not what is the way to get a backup from Stratoes database? How can I configure it to get automatic weekly backup?
If you have mysql installed in your local setup, you can get a backup as just as the same way that you would take a backup of a database that resides in your local database server. For example, the following command would get you a backup of your database that you created under the RSS manager of StratosLive Data Service Server.
mysqldump -u your_username -pyour_password -h rss1.stratoslive.wso2.com extracted_host_name_from_the_JDBC_url_given_to_you database_name > local_file_system_path/backup.sql
Cheers,
Prabath

I have a 18MB MySQL table backup. How can I restore such a large SQL file?

I use a Wordpress plugin called 'Shopp'. It stores product images in the database rather than the filesystem as standard, I didn't think anything of this until now.
I have to move server, and so I made a backup, but restoring the backup is proving a horrible task. I need to restore one table called wp_shopp_assets which is 18MB.
Any advice is hugely appreciated.
Thanks,
Henry.
For large operations like this it is better to go to command line. phpMyAdmin gets tricky when lots of data is involved because there are all sorts of timeouts in PHP that can trip it up.
If you can SSH into both servers, then you can do a sequence like the following:
Log in to server1 (your current server) and dump the table to a file using "mysqldump" --- mysqldump --add-drop-table -uSQLUSER -pPASSWORD -h
SQLSERVERDOMAIN DBNAME TABLENAME > BACKUPFILE
Do a secure copy of that file from server1 to server2 using "scp" ---
scp BACKUPFILE USER#SERVER2DOMAIN:FOLDERNAME
Log out of server 1
Log into server 2 (your new server) and import that file into the new DB using "mysql" --- mysql -uSQLUSER -pPASSWORD DBNAME < BACKUPFILE
You will need to replace the UPPERCASE text with your own info. Just ask in the comments if you don't know where to find any of these.
It is worthwhile getting to know some of these command line tricks if you will be doing this sort of admin from time to time.
try HeidiSQL http://www.heidisql.com/
connect to your server and choose the database
go to menu "import > Load sql file" or simply paste the sql file into the sql tab
execute sql (F9)
HeidiSQL is an easy-to-use interface
and a "working-horse" for
web-developers using the popular
MySQL-Database. It allows you to
manage and browse your databases and
tables from an intuitive Windows®
interface.
EDIT: Just to clarify. This is a desktop application, you will connect to your database server remotely. You won't be limited to php script max runtime, or upload size limit.
use bigdupm.
create a folder on your server witch is not easy to guess like "BigDump_D09ssS" or w.e
Download the http://www.ozerov.de/bigdump.php importer file and add them to that directory after reading the instructions and filling out your config information.
FTP The .SQL File to that folder along side the bigdump script and go to your browser and navigate to that folder.
Selecting the file you uploaded will start importing the SQL is split chunks and would be a much faster method!
Or if this is an issue i reccomend the other comment about SSH And mysql -u -p -n -f method!
Even though this is an old post I would like to add that it is recommended to not use database-storage for images when you have more than like 10 product(image)s.
Instead of exporting and importing such a huge file it would be better to transfer the Shopp installation to file-storage for images before transferring.
You can use this free plug-in to help you. Always backup your files and database before performing this action.
What I do is open the file in a code editor, copy and paste into a SQL window within phpmyadmin. Sounds silly, but I swear by it via large files.

Resources