Restore Full/Differential backup to a new web application in SharePoint 2013 - powershell

I was creating a Full and differential backup of a web application with Backup-SPFarm command. Backup thing is working fine for me.
Can anyone have idea how to restore this full backup to a new web application with Restore-SPFarm command ?
I have tried with powershell and SharePoint central administration, but no success and it is not giving any error as well it saying it is successfully completed.
Using these commands for backup and restore
Backup-SPFarm -Directory 'c:\bkp' -BackupMethod full -Item 'SharePoint - 80' -Verbose
Restore-SPFarm -Directory C:\bkp -RestoreMethod Overwrite -Item "SharePoint - 41434" -BackupId e7e7b9a5-355e-4f6c-b340-c453274b129a -Verbose
Anyone have any idea ?
Thanks

Have you checked the restore-log? Are you restoring it to the same server/environment? I'm not sure you can restore it to the same servers since the content-database will be the same. Have you tried to restore it to a dev-environment?

Related

Can't read migration file using golang-migrate

After running the up command, my database doesn't seem to be recognizing the SQL contained inside relative/path/000001_init_schema.up.sql.
So far:
Verified I have a connection to the database
Successfully executed the SQL inside my database manager (TablePlus)
Relative path is correct (-path db/migration)
Full command:
migrate -path relative/path -database "postgresql://root:secret#localhost:5432/dbname?sslmode=disable" -verbose up
After running the command, I receive confirmation that "no changes have been made", but my database only has a schema_migrations table.
Any other ideas?
Thanks,
Connor
I solved the issue by replacing -path relative/path with -source file://relative/path
Alternatively, you can use -source file:///absolute/path

Error in Export in sharepoint 2013

I am trying to move a subsite of 100Gb by using Export and import commands. But I am getting error when I try this command
Export-SPWeb http://dc/sites/Coms –Path "//servername/W$Backups/cops.cmp" -IncludeVersions ALL -includeusersecurity
In the above command W is the Drive name and Backups is the folder name in that server. Can anyone help? Is this correct or is there any solution? Thanks
Are yo trying to store backup in some other server? In no, then your syntax should be like follow:
Export-SPWeb http://dc/sites/Coms –Path "W:\Backups\cops.cmp" -IncludeVersions ALL -includeusersecurity
Please refer this MSDN link on export web if you want any more guidance on it:
https://technet.microsoft.com/en-us/library/ff607895.aspx

Project Centennial: How to edit outputted XML and call MakeAppx.exe

I’m running into this error while trying to convert my Windows Forms Application using Project Centennial. I was able to run threw the shown VLC tutorial on the MSDN site, so I do know the converter is working. It says I need to “set the 'Application Executable' property in the AppxManifest.xml before calling makeappx manually” but I am not sure how to do that. I have tried using -AppExecutable but it’s not setting, every time it builds it defaults to MyApp.exe. It says I can edit it, but when I do not know how to call MakeAppx.exe with the same XML file.
Here is the command I am using:
.\DesktopAppConverter.ps1 -ExpandedBaseImage C:\ProgramData\Microsoft\Windows\Images\BaseImage-14393 –Installer C:\Users\Mark\Desktop\Newest_Installer\Keyed-Setup.exe -InstallerArguments "/S" -Destination C:\Users\Mark\Desktop\Keyed_App_Filers -PackageName "Keyed" -Publisher "CN=JonesComm" -Version 1.0.2.2 -AppExecutable "KeyedApp.exe" -MakeAppx -Verbose
Here is a picture of the full error.
Error Pic
Thanks in advance for any help you can offer!
Eureka!!! Okay so for about a week solid I have not been able to get this right. I have an MSI and a .exe of my program and I just successfully wrapped the .aapx with the MSI. The command that lead to the break though was “msiexec /?” this shows a list of the commands specifically for that application. “/PASSIVE” is the command needed to run without UI. I was able to set the 'Application Executable' property with “-AppExecutable "Executable(.exe) File Path"-AppInstallPath "Your Applications Installation Path” This is just the name of your applications executable, and where that executable would be located on a new computer after a fresh install.
Here is an editable version of the powershell command I used:
.\DesktopAppConverter.ps1 -ExpandedBaseImage C:\ProgramData\Microsoft\Windows\Images\BaseImage-14393 –Installer C:\Users \Desktop\MyApp\MyApp_Setup.msi -InstallerArguments "/PASSIVE" -Destination C:\Users\Desktop\MyApp-Appx -PackageName "MyApp" -Publisher "CN=Company" -Version 1.0.2.2 -AppExecutable "ApplicationFolder\SubFolder\MyApp.exe"-AppInstallPath "C:\Program Files (x86)\ApplicationFolder\SubFolder" -MakeAppx -Verbose
I hope this helps any newbies out there like me. Project Centennial doesn’t have much for tutorials out there right now. Thanks everyone!!

Cannot find path Powershell script on SQL Server Agent

I've been searching all the internet and stackOF to and resolve this issue.
I am trying to automate a db restore using SQL Server Agent. The sql server agent job comprises of four steps 3 of which are tsql and one which is a powershell script.
I have created a proxy with admin credentials so that the script can be run as admin.
cd c:;
$backuppath="Microsoft.PowerShell.Core\FileSystem::\\sharedcomputer\backup";
$destpath="c:\tmp\";
get-childitem -path $backuppath | where-object { -not $_.PSIsContainer } |
sort-object -Property $_.CreationTime |
select-object -last 1 | copy-item -Destination (join-path $destpath "byte.BAK");
It copies the .bak file from the source shared folder and places it in to tmp folder on the target.
Whenever I run this through regular Powershell it works fine.
Whenever I try to run this from SQL server agent I get an error stating that it cannot find path.
I tried to even use net use to pass credentials for the shared folder. I am thinking it has to do with the fact that the folder has requirement for credentials.
I have turned of password file sharing as well on the source server but for some reason when i use windows explorer to locate the shared file it still asks for credentials initially. Once its saved and cached I can then use powershell to cd in to that folder. But none of this works when its executed from sql server agent
I was able to finally figure this out with a little help from a Windows Server guy...
Going back to answering the question. When I created a proxy agent I used the credentials that were associated with the current Domain Account i.e Domain\Administrator.
In order for the proxy to connect to the remote server it needs to have credentials on that domain.
So what I did was create another domain account on my target and source servers using the same name and password and gave it permissions to the folders I needed
That account was used in the proxy and the credential was set up as .\AccountName, so because the wildcard was in place the proxy was able to jump back and fort between the two servers and successfully transfer the files....
Hope this helps

Issue Accessing File Storage in Azure WorkerRole using Startup Script

I have an Azure Cloud Service Worker Role which needs a separate Windows Service installed to redirect application tracing to a centralized server. I've placed the installation binaries for this Windows Service in a Storage Account's file storage as shown below. I then have my startup task call a batch file, which in turn executes a power-shell script to retrieve the file and install the service
When Azure deploys a new instance of the role, the script execution fails with the following error:
Cannot find path
'\\{name}.file.core.windows.net\utilities\slab1-1.zip' because it does
not exist
However, when I run the script after connecting through RDP, all is fine. Does anybody know why this might be happening? Here is the script below...
cmdkey /add:$storageAccountName.file.core.windows.net /user:$shareUser /pass:$shareAccessKey
net use * \\$storageAccountName.file.core.windows.net\utilities
mkdir slab
copy \\$storageAccountName.file.core.windows.net\utilities\$package .\slab\$package
I always have problem here and there by using a script to access the mounted azure file drive. I believe this is more or less related to the drive is mounted only for the current user and may not always work the same when called from a script.
I ended up pulling files from azure file the hard way without network drive.
$source= $stroageAccountName
$sourceKey = $shareAccessKey
$sharename = "utilities"
$package = "slab1-1.zip"
$dest = ".\slab\" + $package
#Define Azure file share root
$ctx=New-AzureStorageContext $source $sourceKey
$share = get-AzureStorageShare $sharename -Context $ctx
Get-AzureStorageFileContent -share $share -Destination $dest -Path $package -confirm:$false
Code example here will get you a good start:
https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-files/
It would be harder to manage if you have more complex folder structure, but objects there are CloudFileDirectory and CloudFile, property and methods there works seamlessly for me in powershell 4.0
*Azure Powershell module is required for 'Get-AzureStorageFileContent' cmdlet