0

I have made a web page which uses a local SQL database server.
Now that I want to publish the web page and place it online, I have to change everything, because the hosting server uses mySQL and presents me with his own mySQL database, and I don't know how to make that transition, I have an entity model in my solution and the Controller my database.

The specific question is - what are the steps to make that transition?

MicroDev92
  • 169
  • 1
  • 15
  • This is pretty broad. There is no formula for converting from one DBMS to another. Not all datatypes are going to have an exact match, not all the code will work the same way. Honestly switching from sql server to mysql because the host uses mysql is a pretty good indication that you need to find another host that allows sql server. – Sean Lange Feb 21 '17 at 19:36
  • it's not my decision I didnt get the information in time, now I'm trying to fix the damage, I have that "server" mySQL I can run queries I can create tables but how do I place those tables inside of my webpage which is hosted?! how do I change the configuration online, they made it pretty stupid and twisted. – MicroDev92 Feb 21 '17 at 19:44

3 Answers3

1

1 use SQL Tools (don't know what version you have) do a full backup.
2 from the new hosting server, restore the database.
3 change your connection strings or path (depends on programming environment) to use new MySQL.

Here is a link to what I used when I migrated in a similar way as to automate the whole process(Yes, it took a little learning but worth it). https://www.youtube.com/watch?v=rpPANKhbpDs

TheGameiswar
  • 27,855
  • 8
  • 56
  • 94
twc
  • 449
  • 1
  • 3
  • 12
  • Also, if you explain a bit more about what systems you have it might be easier to help. :twc – twc Feb 21 '17 at 19:55
  • I made the site in VS12015 and I have a connection string to my localDB, but now I was given mySQL php edition -.- which isn't helpful at all, because now I don't know what to change, where to change it, and what not, I really need someone to have patience and take me through it, the only thing I managed to do is make a table in the new mysql database – MicroDev92 Feb 21 '17 at 20:01
  • which info do You need? xD – MicroDev92 Feb 21 '17 at 20:08
  • You have two versions of SQL - Ok #1 - See if you can backup the myPHP SQL, download it and import it on your local SQL. You can do this using myPHPAdmin. – twc Feb 21 '17 at 20:55
  • yeah I had to use that Admin you speak of, that is where I created the table I needed...Question, can I import my database with App_Data folder, through FileZilla on the server and then use it from there? I'm trying to find maybe a plan B way to avoid using myPHPadmin and mySQL and someone suggested that I should import the App_Data folder on server and that is the way I don't have to use mySQL, is this true? – MicroDev92 Feb 21 '17 at 21:28
  • Well, App_Data "might" have your actual SQL Server data files --- there are two of them or more depending on how many databases you might have on the SQL. But, short answer NO -- you have to import and export data from each SQL server and this is only if it is allowed per SQL. – twc Feb 21 '17 at 21:39
  • What I thought might work and be simple would be backup from MySQL and see if you can Import it into the SQL local -- if you, Export and see if you can Restore on MySQL. Either way you need to figure on BACKUP/RESTORE or IMPORT/EXPORT. – twc Feb 21 '17 at 21:42
  • okay that is logical, maybe it is helpful to know that there is no actual "data" I haven't been storing any, mb I should have mentioned that in the beggining, there is only 1 database and has only 1 empty table which the website needs to populate when the user enters information. does that simplify the method? since there is no actual stored data? – MicroDev92 Feb 21 '17 at 22:01
  • yes --- empty database means you just need to switch connection strings and it "should" work. – twc Feb 21 '17 at 22:16
  • okay but the database name is not the same, and entities too, how will my controller know where to store information, and the connection string is the worst of all, since I don't know where to type and what to type. Only the table has the same name since I created it in the myPhpAdmin – MicroDev92 Feb 21 '17 at 22:18
  • You might try to right click the SQL table on your local SQL and "script it to file" then try to open the phpAdmin from Hosted and open Query Anaylizer paste that script into there to recreate the table. That could get you started -Tim: – twc Feb 21 '17 at 22:21
  • Oh about the connection string, in VS2015, goto view then SQL Explorer, right click the database to see the connection string. Either it is put in the webconfig file or in a file in the MODEL folder. – twc Feb 21 '17 at 22:30
  • Could I possibly create the same database (like in the 'admin') in my SQL local server and then implement it to my site through visual studio, because then it will set entities and names in the debug and then i would just upload it to FileZilla, if you understand what I'm talking about xD the connString is in the web.config file, but I don't understand what are inital catalogs and a bunch of other stuff there :/ – MicroDev92 Feb 21 '17 at 22:31
  • I apologize for boring You too much with prolly beginner questions! – MicroDev92 Feb 21 '17 at 22:34
  • You can do this "Deploy" website using VS2015 - however, it must be VS2015 compatible. I would take a few mins to get a quick video overview I put in the above as it would guide you much further and within a few hours you could be done! Very enthusiastic for you. – twc Feb 21 '17 at 22:42
  • 1
    https://blogs.msdn.microsoft.com/uk_faculty_connection/2015/07/20/using-visual-studio-2015-and-deploying-your-first-web-app-to-your-free-azure-subscription/ – twc Feb 21 '17 at 22:52
0

try to install mysql connector https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework60.html

0

MySQL Workbench provides you with the Migration Wizard feature. It allows you to migrate databases from various RDBMS products to MySQL.

This documentation would help you get started,... http://mysqlworkbench.org/2012/07/migrating-from-ms-sql-server-to-mysql-using-workbench-migration-wizard/

There are also several paid tools available which convert MS SQL to MySQL, but I've never used them personally. These tool come with free trial so you can actually test them before purchase. You can also refer similar threads on Stackoverflow,...

How to migrate SQL Server database to MySQL?

How to export SQL Server database to MySQL?

Community
  • 1
  • 1
AccuWebHosting.Com
  • 1,159
  • 1
  • 7
  • 17