Solved

One Drive_Backup

Posted on 2016-10-26
7
14 Views
Last Modified: 2016-11-08
I have and old backup of files I'm trying to sync to OneDrive, I get all errors on file name contains characters or path too long.

How can I bypass that policy as I have 400gb of files to upload.

of there is a different place for this kind of files on office 365
0
Comment
Question by:alonig1
  • 4
  • 2
7 Comments
 
LVL 39

Expert Comment

by:Vasil Michev (MVP)
ID: 41860720
You cannot bypass the policy. ODFB is not designed to be a replacement for file shares or used as a backup solution. You can certainly try to use them as such, but dont expect them to function the same.

That being said, Microsoft is constantly improving on the list of unsupported chars and should also be making some changes around the path length soon.
0
 

Author Comment

by:alonig1
ID: 41860722
What do I do with all of files that can't be upload.

She must be a solution.
0
 
LVL 39

Expert Comment

by:Vasil Michev (MVP)
ID: 41860731
Rename them?
0
Do email signature updates give you a headache?

Are you constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

 

Author Comment

by:alonig1
ID: 41860736
Yes Vasil Michev,

I will rename millions of files.

Why didn't I think about it?
0
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 41866461
one could always use powershell to find and fix but it would no longer be a 'backup'
    function Check-IllegalCharacters ($Path, [switch]$Fix, [switch]$Verbose)
    {
     # http://get-spscripts.com/2011/11/use-powershell-to-check-for-illegal.html
        Write-Host Checking files in $Path, please wait...
        #Get all files and folders under the path specified
        $items = Get-ChildItem -Path $Path -Recurse
        foreach ($item in $items)
        {
            #Check if the item is a file or a folder
            if ($item.PSIsContainer) { $type = "Folder" }
            else { $type = "File" }
           
            #Report item has been found if verbose mode is selected
            if ($Verbose) { Write-Host Found a $type called $item.FullName }
           
            #Check if item name is 128 characters or more in length
            if ($item.Name.Length -gt 127)
            {
                Write-Host $type $item.Name is 128 characters or over and will need to be truncated -ForegroundColor Red
            }
            else
            {
                #Got this from http://powershell.com/cs/blogs/tips/archive/2011/05/20/finding-multiple-regex-matches.aspx
                $illegalChars = '[&{}~#%]'
                filter Matches($illegalChars)
                {
                    $item.Name | Select-String -AllMatches $illegalChars |
                    Select-Object -ExpandProperty Matches
                    Select-Object -ExpandProperty Values
                }
               
                #Replace illegal characters with legal characters where found
                $newFileName = $item.Name
                Matches $illegalChars | ForEach-Object {
                    Write-Host $type $item.FullName has the illegal character $_.Value -ForegroundColor Red
                    #These characters may be used on the file system but not SharePoint
                    if ($_.Value -match "&") { $newFileName = ($newFileName -replace "&", "and") }
                    if ($_.Value -match "{") { $newFileName = ($newFileName -replace "{", "(") }
                    if ($_.Value -match "}") { $newFileName = ($newFileName -replace "}", ")") }
                    if ($_.Value -match "~") { $newFileName = ($newFileName -replace "~", "-") }
                    if ($_.Value -match "#") { $newFileName = ($newFileName -replace "#", "") }
                    if ($_.Value -match "%") { $newFileName = ($newFileName -replace "%", "") }
                }
               
                #Check for start, end and double periods
                if ($newFileName.StartsWith(".")) { Write-Host $type $item.FullName starts with a period -ForegroundColor red }
                while ($newFileName.StartsWith(".")) { $newFileName = $newFileName.TrimStart(".") }
                if ($newFileName.EndsWith(".")) { Write-Host $type $item.FullName ends with a period -ForegroundColor Red }
                while ($newFileName.EndsWith("."))   { $newFileName = $newFileName.TrimEnd(".") }
                if ($newFileName.Contains("..")) { Write-Host $type $item.FullName contains double periods -ForegroundColor red }
                while ($newFileName.Contains(".."))  { $newFileName = $newFileName.Replace("..", ".") }
               
                #Fix file and folder names if found and the Fix switch is specified
                if (($newFileName -ne $item.Name) -and ($Fix))
                {
                    Rename-Item $item.FullName -NewName ($newFileName)
                    Write-Host $type $item.Name has been changed to $newFileName -ForegroundColor Blue
                }
            }
        }
    }

Open in new window

0
 

Accepted Solution

by:
alonig1 earned 0 total points
ID: 41873283
I found a 3rd party tool that did the work for me. thinkscape.com

I wish there was a free tool
0
 

Author Closing Comment

by:alonig1
ID: 41878470
solved.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Office 2016 Install Options 11 56
Office 365 switch to new domain 6 33
office 365 2 40
Prevent spoofed emails for Office 365 customer 4 45
If you don't know how to downgrade, my instructions below should be helpful.
Find out what you should include to make the best professional email signature for your organization.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now