0

I have a asp.net mvc 4 website. It's database was created using the code-first method. However this website of mine is a blog and i uploaded it to my server. Now i have a few articles and i wanna do some changes - add keywords for example, but this requires changing the model of the articles, if it's local i can easily migrate the new model to the database with the package manager console(VS2012) but how do i do that when it's on my hosting company's server. I didn't find any good results in google. Thank you

1 Answer 1

2

I would assume you would just point the connection string that entity framework is using to the database on the remote host rather than your local machine. You're using migrations and I have only used the database initializers (that change the database schema when the model changes), but I can't see it being much different.

Sign up to request clarification or add additional context in comments.

4 Comments

yeah..so just have to change my connection string to use the database of my hosting provider.
I think that's all you should have to do. After that, the migrations should take effect on the new database.
however i don't know the ip they give me localhost ip, do you have an idea where i could find that or i should ask them
From what I'm understanding.. you put everything that was local onto your host. Now, when you update your model, your local database is getting updated instead of the database that the application is actually using. If this assumption is correct, changing your connection string to point to the new database (on your host) should fix the problem. Your hosting provider should provide you with this information. If you have a control panel, I would check there first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.