将LIVE Kentico实例及其数据库复制到我的本地计算机上 [英] Copy a LIVE Kentico instance and its database to my local machine
问题描述
错误似乎是这样的:
错误:发生错误:必须存在具有默认数据的文件夹.
ERROR: An error occurred: Folder with default data must exist.
这是我重新创建的步骤.
Here are my steps to recreate.
我已阅读如何将Kentico实例复制到本地机器?,并按照其所有步骤操作.它没有解决我的问题. Kentico一直希望我执行步骤1-数据库实例",当我执行这些步骤时,会收到上述错误.
I have read How to Copy Kentico Instance to a Local Machine? and followed all of its steps. It did not resolve my issue. Kentico keeps wanting me to do "Step 1 - Database Instance," and when I go through those steps, I receive the above error.
这是我采取的步骤:
- 备份LIVE数据库.
- 将其恢复到本地.
- 添加适当的服务器登录名和数据库用户.
这是我添加服务器登录名的方式
This is how I add the Server Login
USE [master]
GO
CREATE LOGIN [myUser] WITH PASSWORD=N'myPassword',
DEFAULT_DATABASE=[master],
CHECK_EXPIRATION=OFF,
CHECK_POLICY=OFF
GO
ALTER SERVER ROLE [sysadmin] ADD MEMBER [myUser]
GO
这是我配置数据库用户的方式
Here is how I configure my database user
CREATE USER [myUser] FOR LOGIN [myUser] WITH DEFAULT_SCHEMA=[dbo]
GO
这是分配的数据库角色
GO
ALTER ROLE [db_owner] ADD MEMBER [myUser]
GO
ALTER ROLE [db_ddladmin] ADD MEMBER [myUser]
GO
ALTER ROLE [db_datareader] ADD MEMBER [myUser]
GO
ALTER ROLE [db_datawriter] ADD MEMBER [myUser]
GO
ALTER ROLE [db_owner] ADD MEMBER [myUser]
GO
ALTER ROLE [db_owner] ADD MEMBER [myUser]
GO
ALTER ROLE [db_owner] ADD MEMBER [myUser]
GO
ALTER ROLE [db_datareader] ADD MEMBER [myUser]
GO
ALTER ROLE [db_datawriter] ADD MEMBER [myUser]
GO
ALTER ROLE [db_owner] ADD MEMBER [myUser]
GO
代码库
- 在本地检出现有代码库.
- 设置IIS以承载现有代码库.
web.config
更改连接字符串以指向我的本地SQLExpress
web.config
Change the connection string to point at my local SQLExpress
<add name="CMSConnectionString"
connectionString="Persist Security Info=False;
database=MyKentico;
server=.\SQLEXPRESS;
user id=myUser;
password=myPassword;
Current Language=English;
Connection Timeout=240;" />
主机
添加以下条目:
hosts
Add the following entry:
127.0.0.1 ca.myKentico.local
结果
当我转到ca.myKentico.local时,出现以下屏幕.
Result
When I go to ca.myKentico.local, the following screen appears.
因此,我单击下一步",然后出现以下屏幕.
So, I click Next, and the following screen appears.
下一步.
这时,屏幕底部显示错误消息.
At this point, there is an error message at the bottom of the screen.
错误:发生错误:必须存在具有默认数据的文件夹.
ERROR: An error occurred: Folder with default data must exist.
推荐答案
请尝试这样的连接字符串以查看其是否有效:
Please try a connection string like this to see if it works:
<add name="CMSConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=Kentico82;Integrated Security=False;User ID=MyUser;Password=MyPassword;Connect Timeout=240" />
谢谢.
也可能是您在本地重新创建了数据库架构而不添加数据.运行以下查询以确保您具有本地数据.
It also might be that you recreated your db schema locally without adding the data. Run the following query to make sure that you have local data.
SELECT *
FROM [dbo].[CMS_UIElement]
如果其中没有数据,则您没有管理员用户界面.您需要运行将数据从LIVE数据库导入到本地数据库中.
If there's no data in there, then you don't have an admin user interface. You'll need to run import the data from your LIVE database into your local one.
这篇关于将LIVE Kentico实例及其数据库复制到我的本地计算机上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!