问题
I just started a new position replacing a developer who left abruptly working on a project that is based in the Kentico CMS. I am completely unfamiliar with ASP and Kentico, so the answer here needs to be tailored for a total beginner. I am familiar with other languages (PHP, Ruby, SQL, etc.) but have no idea where to begin with this.
So, want I am wanting to do is copy everything from our production site (db and all) to my local machine so I can develop on it easier. I have already exported the db into an SQL file, and copied all the files in our Kentico Instance folder into github, and cloned it on my local machine. I assume since Kentico is already "setup," going through the installation process in their documentation is not the way to go about this.
Any help would be incredibly appreciated!
回答1:
David, basically there are a few "pieces" to running Kentico locally. Since, as you mentioned, Kentico is already set up, you should have an easier go of it.
- A database with the necessary Kentico tables (it sound like you already have this)
- The codebase (all of the code files that you copied to github)
- A valid license for any domain you want to run Kentico on. Was the site already public facing? Do you know what licenses you have or can you log into the CMS Desk on the site that you copied everything from?
- Set up IIS for your local website. If you are unsure on this one I can explain further, but basically you need to add a new site, point it to the root code folder for your site, and set the domain to be a domain you have a Kentico license key for. You'll also need to change the app pool settings to "integrated" mode (most likely) and also set the appropriate version of .NET (if it's a recent version of Kentico you'll want .NET 4.0)
- Next you'll need to edit your hosts file to add the domain and point it to your localhost IP address. So add a line like "127.0.0.1 dev.yourdomain.com" or the equivalent.
- Edit the web.config file so that your code can connect to your database. You will need to edit the connection string accordingly to point to the database on your machine.
Once you have done these steps, your site should start to run just as it had before. I didn't give great detail on all of these pieces so let me know what problems you encounter so I can further clarify. More information about the current situation would also help.
One other note I would make: if you need the client to be able to review your work, it will most likely be more efficient and easier for you to leave the original database on the web server, and (if possible) connect to it remotely from your local machine. Since almost any change you make will result in a database change in Kentico, I find it much easier to be working on 1 database for development with distributed codebases. Otherwise you will probably need to overwrite the other database with your changes constantly and this can be annoying. If you leave the database on the server and just connect remotely, you can just ftp (or use git) to push files to the server that you have edited locally.
来源:https://stackoverflow.com/questions/13649939/how-to-copy-kentico-instance-to-a-local-machine