SilverStripe CMS Installation and Development - database

I am very new to cms and I am wondering if you fine gentleman can help me get started properly. Just a note, I have spent hours researching my questions and I could not find the answer I was looking for.
I have installed silverstripe locally and i started creating my own site with it. Created a new theme, deleted the old 2. It created some random database for me, it was mostly automated. Now I have a server, and I want to put it on my server, but I can't figure out for the life of me how to import it. I was able to install silverstripe and have a default theme (simple) running, but no matter what file I copy or change, it never loads my site. Does anyone has a tutorial on how this is achieved? server is with godaddy.
When I started creating this site, it created a database with a random name, how can I rename that database? What are the files I need to update?
How do I access phpmyadmin locally? localhost:port/phpmyadmin does not works.

1. Site deployment
Here is how I deploy a Silverstripe website to a live server.
ftp into the server
Upload all the files from the development folder to the server
Create a database on the server
Create a database user for the database and add all database privileges
Update the live mysite/_config.php file with your live database username, password and database name
Dump your local database
Import your database dump into your live server database
Call dev/build/?flush=all on your live server
Check the website works
Have a beer
2. Database renaming
The database settings are stored in mysite/_config.php. They should look something like this:
$databaseConfig = array(
'type' => 'MySQLDatabase',
'server' => 'localhost',
'username' => 'database_username',
'password' => 'database_password',
'database' => 'database_name'
);
To rename the database, rename your database in phpmyadmin. Then update your $databaseConfig database name in your mysite/_config.php file.
3. localhost phpmyadmin
Webmatrix does not come with phpmyadmin. You can download it, extract it to your webmatrix html root directory and use it. Or you can download an alternative like adminer, which is a one file database manager.

With regards to renaming your database, see the comments above as they are accurate.
However you still seem to be having problems getting your database out of your local environment, so let's concentrate on that first and see how you go with it.
Note that there are at least two ways you can back up/export your local database:
1). Using phpMyAdmin (Or other web-based DB utility)
2). Using the command line (see the 'mysqldump' command)
You asked about using phpMyAdmin to backup your SilverStripe database so I'll address only 1). above:
As this is specfic to your own development environment and you've not mentioned how far you've got in setting this up locally, nor any error messages you may have received, myself and others can only go so far in helping you out with this.
If you've setup phpMyAdmin as per the installation requirements, it should be installed by default and accessible at this address on your computer:
http://localhost:80/phpmyadmin
The following will also work, as port 80 is the default for most webservers:
http://localhost/phpmyadmin
If neither of these work and you receive a 404, 403 or 500 error (The screen in the browser should tell you which of these has occurred) I'm pretty confident you've not set it up correctly on your system. My suggestion is therefore to go back to the phpMyAdmin docs and re-check you've performed everything correctly as per your own environment setup (e.g. for Linux, OS X, Windows etc).
Once you're setup correctly, have a crack at the DB renaming suggestions above and coe back for more help if you need it.

Related

VS2019 MVC Database solution won't work on a second machine

I had created a webpage with DB access which works perfectly well on the machine I develop it. However, when I copy everything across to another machine, it fails with an error message - cannot open database xxx requested by the login. I did copy everything including the database created in the development environment and put it in the same place as the development did. What other thing I had done wrong ? Please help. In addition, when I open the solution on another machine, I cannot see the database from the SQL Server Object Explorer like what I saw on the development machine.
Problem solved ! Need to copy the database and the log file across and the used the SQL Server Manager to attach the database to the right server. After that, everything just work !!

How to restore OpenCart 3.0.3.2 database?

I am using OpenCart version 3.0.3.2, and for some reasons i want to move my entire store from the server to localhost. I have downloaded all the store files from the server to my local folder and it is working well i can see my themes, extensions and all other modifications.
The only problem now is that the database is missing.
Things i have tried:
I have tried the traditional way to make backup and then restore from the admin dashboard. Admin->System->Maintenance->Backup/Restore. The backup is from the server store and then restore that file from localhost. After the loading of restoring SQL file it show me a successful restoring message but nothing change when i refresh the store!!.
I have entered the c-panel from the server and went to phpmyadmin page then export the database. After that the same things in localhost went to phpmyadmin page then import that file from the server. i have got successfully import message also but again nothing changes in the store, i cant see my products, store information or all other additions.
I have tried to clear the cache from the admin dashboard if it is some how related to this but nothing changes.
I am stuck now and i dont know how to get all the information of the store in my localhost if anyone can help me. Thanks in advance.

get database from xampp (not via phpmyadmin)

I would like to ask, if it is possible to get my database from an offline (not functioning) xampp ?
You see, I have backed up my database earlier but I am not sure whether there are all the data I need now and the DB is pretty big (like 50 tables). I wanted to go for a local implementation of apache, mysql and PHP for my web applications. So I have reinstalled mysql and want to use my own local apache server instead of xampp.
I would like to know where can I find some .sql or something that is stored in xampp that could be otherwise accessible via the phpmyadmin? Is it even possible? I have scrolled through the xampp folder and tried to figure out where it can be, but didnt find anything though.
Thanks for help.
EDIT
I am on a mac running mavericks.
First go to localhost/phpmyadmin and create a database as before you have. Then import your database file through browse.
If your database name exmaple.sql then create database name will be example and import example.sql

Cpanel doesnt show database but it does exist

I have a problem with Cpanel, or atleast with my database, because i cant see my database trough either cpanel,mysql databases or phpmyadmin but when i tried to run a import sql script it states that the database exists. How can i access my database, i have heard some databasemapping resets on cpanel level but the problem is that i cant access the server on any way(only my site via FTP ofcourse).
It looks like i dont have permission, also my firstly created (head mysql account) is gone, or atleast i cant login with the same credentials as before. Whenever i try to add an mysql user it says completed(user created succesfully) but when looking at all users there aren't any users stated.
Sounds strange doesn't it?
I hope someone knows the answer, i need the database back.
You can use Adminer for importing and exporting data via ftp. Please try.

Key steps to uploading a Drupal website from Local to live using a hosting firm

I'm a newbie to pushing Drupal websites from local to live via a CP panel with a hosting company and wondered if there are any key steps I need to follow? I usually end up with Internal Server 500 errors or no themes showing so not a good start!
The steps I follow are:
Export the database from my local PHPMyAdmin
Log into my hosting CP Panel and create the database on there
Create a user for the database (with password)
Change the settings.php to match the database settings
Load all Drupal files via FTP
Create a 'tmp' folder in the 'sites > default> files' directory
What am I doing wrong?! Is it something to do with the .htaccess file as to why I either get the error or my theme never shows?
Any help would be much appreciated! So stressful and frsutrating as a newbie! Once I've done 1 I'm hoping it'll be plain sailing!!
Thanks!
C
You have the basic steps right. Check the php error logs on the server (probably accessible via the control panel if you dont have ssh access), they should give you more information as to what actually caused the 500 errors.
Doubt it is an htaccess issue unless you are doing something crazy in there.
Can you see he drupal admin at all? If so, clear cache, check watchdog for clues also.
It's easier to download and install Drupal again on the live server rather than to copy everything via FTP. The settings.php file is where your MySQL information is stored so this file should not be copied. Follow Drupal's documentation on how to install Drupal at https://drupal.org/documentation/install/download
To transfer your database, install and enable the Backup and Migrate module on your local server from https://drupal.org/project/backup_migrate and back up your database locally.
After Drupal is installed on the live server, go ahead and copy your modules, themes, and files from /sites/all and /sites/default/files (or any non-Drupal core files that you may have created). Enable and use the Backup and Migrate module to restore your database to your live server. You may need to configure the php.ini file if the database is over 8MB.

Resources